A Technique for Virtually Expanding Queryable EJB CMP Entity Bean Fields
Original Publication Date: 2002-Feb-20
Included in the Prior Art Database: 2003-Jun-20
Disclosed is a technique for virtually expanding queryable EJB CMP entity bean fields. Introduction: An entity bean does not necessarily contain all attributes required by all conceivable business applications that use that entity bean, and users are likely to demand the ability to add user-defined attributes to an entity definition. For example, an EJB provider may provide an entity bean that represents a Person, and it has several attributes identified by general requirements, such as "name" and "age". However, a user may require an extra attribute called "nationality" to an entity definition representing a person, and another user may require another attribute called "height". Another user may require something you would never imagine. When a new attribute is added to a CMP entity bean, it involves the modification of the corresponding database table. When that field is a subject of a search on the persisted data, the addition also requires the modification of the implementation to add a new finder method. One of the approaches that have been taken to resolve this need for the modification by the entity bean users is to handle all attributes in one field with separators in between. This method does remove the need for the modification of the database table, but it puts a restriction on the search in that it requires all persisted data to be instantiated in order to search for a particular data.