org.netbeans.modules.j2ee.deployment.common.api
Interface OriginalCMPMapping


public interface OriginalCMPMapping

This interface provides an abstraction for the original relational database information used to generate an Entity container managed persistence bean. Changes to cmp or cmr fields made after generation will not be reflected in this interface and may invalidation the original mappings. Thus, this information is intended to serve only as a hint for application server mapping.


Method Summary
 String getEjbName()
           
 String getFieldColumn(String cmpFieldName)
           
 String[] getRelationshipColumn(String cmrFieldName)
          Obtain the foreign key columns used to express a 1:N relationship.
 String getRelationshipJoinTable(String cmrFieldName)
          Obtain the name of the join table a cmr field is based on.
 org.openide.filesystems.FileObject getSchema()
           
 String getTableName()
           
 

Method Detail

getSchema

org.openide.filesystems.FileObject getSchema()
Returns:
file reference to dbschema where table and column references refer.

getEjbName

String getEjbName()
Returns:
ejb name.

getTableName

String getTableName()
Returns:
table name containing all column references.

getFieldColumn

String getFieldColumn(String cmpFieldName)
Parameters:
cmpFieldName - to use for locating column mapping.
Returns:
name of column which represents the cmp field in #getTable() or null if this cmp field does not have a mapping (this could happen because of a change to the set of cmp fields or changes to the specific cmp field).

getRelationshipColumn

String[] getRelationshipColumn(String cmrFieldName)
Obtain the foreign key columns used to express a 1:N relationship. This method will return the mapping only from the dependant EJB. Consider a an Order to LineItem relationship (Order contains many line items) where Order has a cmr field called lineItems and LineItem has a cmr field named order. Invoking getRelationshipColumn("lineItems") on Order would return null; however, the same invocation on LineItem would return the foreign keys which reference Order. Mapping information for M:N relationships is obtain via the #getRelationshipTable(java.lang.String) method.

Parameters:
cmrFieldName - to use for locating column mapping.
Returns:
name of columns representing the cmr field in #getTable() or null if the field was not present during creation or is participating in a many to many relationship.

getRelationshipJoinTable

String getRelationshipJoinTable(String cmrFieldName)
Obtain the name of the join table a cmr field is based on. Both sides of the relationship will return the same table name.

Parameters:
cmrFieldName - to use in decision.
Returns:
name of join table if cmrFieldName is based on a join table, null otherwise.

 

Built on March 27 2006.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.