Business Components provide a mechanism to provide non-persistent business logic (as opposed to business entities that add to persistent objects). An example business component is as follows:
/**
* Component used to query for {@link Person} instances based on various
* predefined criteria.
*
* @BusinessComponent
* (customizationReplaceable = false)
*/
public class PersonFinders_Impl
extends GenericBusinessComponent
implements PersonFinders
/**
* @param nameType a name type
* @return count of names by name type
*
* @BusinessMethod (customizationCallable = true)
*/
public int findCountByNameType(Lookup nameType) {
Query query = createQuery
("FROM PersonName name where name.nameType = :type");
query.bindLookup("type", nameType);
return (int) query.listSize();
}
To add a new component: