Wrapbeans and implementation methodsThis example introduces the wrapbean: this is a bean that doesn't come directly out of the database, but that is created in a self-defined Java-method. Suppose you need the change the result that comes from the database, an operation that for some reason has to happen in java code. In the following trivial example the extra operation is turning the name into uppercase. Have a look at the getEnrichedNameList() method defined below. The NameBean is a regular bean, that is returned by getNameList() from the database. The method getEnrichedNameList() uses getNameList() as input and creates a list of EnrichedNameBeans. Bean definition
Service definition
Full bean and service definition : Wrimp.mlg Note that the method getNameList() is delared to be 'implementation' only. This means that in the service implementation this method will be declared private, and that it won't even show up in the service interface definition. The database tablet_name
The Main java class
Output
All FilesSQL file(s): Java file(s):
Mlg file(s): |