Make your own free website on Tripod.com

The Entity Engine API

The GenericDelegator class is use to create, find, store and other operations on a GenericValue object - a value object.

This is how you typically create a new entity instance:

Long cmId = delegator.getNextSeqId("ContactMech");
GenericValue partyContactMech = 
  delegator.makeValue("PartyContactMech", 
   UtilMisc.toMap("partyId", partyId, 
    "contactMechId", cmId.toString(),
    "fromDate", now, "roleTypeId", context.get("roleTypeId"), 
    "allowSolicitation", context.get("allowSolicitation"), 
    "extension", context.get("extension")));
partyContactMech.create();

To update an existing entity, use the store() method:

partyContactMech.store();