What's the appropriate way to modify ViewEntities?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

What's the appropriate way to modify ViewEntities?

Patrick-4
What's the appropriate way to modify a viewEntity?  I have a
viewEntity, FacilityAndContactMechAndAddress, and it has 3 primary
keys, but they don't seem to work as expected.   I tried the code
below, but it says bad primary key.   Am I taking the wrong approach?
Also do you think I should do this at the java service level or the
simple-method level?

<!-- this didn't quite work, bad primary key (but this works if I
change entity-name to Facility for facility fields)  -->
<set field="lookupPKMap.facilityId" from-field="parameters.facilityId"/>
 <find-by-primary-key entity-name="FacilityAndContactMechAndAddress"
map="lookupPKMap" value-field="facilityId"/>
 <set-nonpk-fields map="parameters" value-field="facilityId"/>
<store-value value-field="facilityId"/>

Thanks
Patrick
Reply | Threaded
Open this post in threaded view
|

Re: What's the appropriate way to modify ViewEntities?

Scott Gray-2
Hi Patrick

From memory, a view entity will only be modifiable if the primary keys for all included entities are present.

As a best practice, you should generally only perform write/update/delete operations on entities via the services available, doing so will ensure that all related SECAs are run.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/02/2010, at 8:51 AM, Patrick wrote:

> What's the appropriate way to modify a viewEntity?  I have a
> viewEntity, FacilityAndContactMechAndAddress, and it has 3 primary
> keys, but they don't seem to work as expected.   I tried the code
> below, but it says bad primary key.   Am I taking the wrong approach?
> Also do you think I should do this at the java service level or the
> simple-method level?
>
> <!-- this didn't quite work, bad primary key (but this works if I
> change entity-name to Facility for facility fields)  -->
> <set field="lookupPKMap.facilityId" from-field="parameters.facilityId"/>
> <find-by-primary-key entity-name="FacilityAndContactMechAndAddress"
> map="lookupPKMap" value-field="facilityId"/>
> <set-nonpk-fields map="parameters" value-field="facilityId"/>
> <store-value value-field="facilityId"/>
>
> Thanks
> Patrick


smime.p7s (3K) Download Attachment