Under classic Cúram, you would have created a call to the generated "entity" method as follows:
public class MyFacade { // ... public SomeEntityDetails viewSomeEntityDetails( final SomeEntityKey key) throws AppException, InformationalException { // create an instance of the return struct final SomeEntityDetails someEntityDetails = new SomeEntityDetails(); // objects for reading the database final SomeEntity someEntityObj = SomeEntityFactory.newInstance(); final SomeEntityKey someEntityKey = new SomeEntityKey(); final SomeEntityDtls someEntityDtls; // map the key someEntityKey.someEntityID = key.someEntityID; // do the read someEntityDtls = someEntityObj.read(someEntityKey); // map the details returned - in this situation the return // struct aggregates the generated entity Dtls struct someEntityDetails.details = someEntityDtls; // return to the client return someEntityDetails; }
How do you read from a database table using a service-layer API (developed using the Persistence Infrastructure)?