You are writing a façade method which needs to cancel an existing row on the database (i.e. set its "recordStatus" to "Canceled").
Under classic Cúram, you would have created a call to a non-stereotyped "entity" method as follows:
// ... public void cancelSomeEntityDetails( final SomeEntityKeyVersion key) throws AppException, InformationalException { // objects for writing to the database final SomeEntity someEntityObj = SomeEntityFactory.newInstance(); // create an instance of the key/version final SomeEntityKeyVersion someEntityKeyVersion = new SomeEntityKeyVersion(); someEntityKeyVersion.someEntityID = key.someEntityID; someEntityKeyVersion.versionNo = key.versionNo; // do the cancel someEntityObj.cancel(someEntityKeyVersion); // check for informational exceptions TransactionInfo.getInformationalManager().failOperation(); } // ...
How do you cancel an existing row on a database table using a service-layer API (developed using the Persistence Infrastructure)?