Home › Forum › Nuclos Entwicklung › Schnittstellen › CRUD (user made) entities from Java code › Aw: CRUD (user made) entities from Java code
Hello,
you can use the MasterDataFacadeBean and/or GenericObjectFacadeBean to access the entities. The functionality is similar to the RuleInterface, i.e. most data accessor methods of the RuleInterface delegate to one of both facades (see RuleInterfaceFacadeBean). On the client side, you get an instance of the facade’s remote interface via ServiceLocator.getInstance().getFacade(XXXRemote.class).
The following list gives a short overview of the most important CRUD methods:
MasterDataFacadeRemote:
– MasterDataVO create(String entity, MasterDataVO mdvo, DependantMasterDataMap mpDependants): creates a new master data record
– MasterDataVO get(String entity, Object oId): gets the master data value object for the given id
– Collection getMasterDataIds(String entity): gets the ids of all masterdata objects
– Collection getMasterDataIds(String entity, CollectableSearchExpression cse): gets the ids of all masterdata objects that match a given search expression (ordered, when necessary)
– modify(String entity, MasterDataVO mdvo, DependantMasterDataMap mpDependants): modifies an existing master data record.
– remove(String entity, MasterDataVO mdvo, boolean removeDependants): deletes an existing master data record
GenericObjectFacadeRemote:
– GenericObjectVO create(GenericObjectWithDependantsVO gowdvo): creates a new generic object, along with its dependants.
– GenericObjectVO get(Integer genericObjectId): gets the generic object for the given id
– List getGenericObjectIds(Integer moduleId, CollectableSearchExpression cse): gets the ids of all leased objects that match a given search expression (ordered, when necessary)
– GenericObjectWithDependantsVO modify(Integer moduleId, GenericObjectWithDependantsVO gowdvo): updates an existing generic object and returns the written object along with its dependants.
– remove(GenericObjectWithDependantsVO gowdvo, boolean deletePhysically): delete a generic object
Which to use depends on whether the entity has a state model (GenericObject) or not (MasterData). Please note that this dichotomy will be removed in a future version of Nuclos and both facades will be replaced with a unified service.
Best regards,
alpha