| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PersistenceStructureService
This interface defines methods that a Persistence Service must provide. PersistenceMetadataService provides access to persistence-layer information about persistable classes.
| Method Summary | |
|---|---|
|  Object | clearPrimaryKeyFields(Object persistableObject) | 
|  Class<? extends PersistableBusinessObjectExtension> | getBusinessObjectAttributeClass(Class<? extends PersistableBusinessObject> clazz,
                                                               String attributeName)This method is a PersistableBusinessObject specifific utility method. | 
|  String | getForeignKeyFieldName(Class persistableObjectClass,
                                             String attributeName,
                                             String pkName) | 
|  ForeignKeyFieldsPopulationState | getForeignKeyFieldsPopulationState(PersistableBusinessObject bo,
                                                                     String referenceName)This method checks the foreign keys for a reference on a given BO, and tests that all fk fields are populated if any are populated. | 
|  Map | getForeignKeysForReference(Class clazz,
                                                     String attributeName)This method will return a Map of all the foreign key fields and the corresponding primary key fields for a given reference. | 
|  Map<String,String> | getInverseForeignKeysForCollection(Class boClass,
                                                                     String collectionName)Returns a listing of the FK field mappings between a BO and the elements in a collection. | 
|  Map | getNestedForeignKeyMap(Class persistableObjectClass)Builds a map of reference pk attributes back to the foreign key. | 
|  List | getPrimaryKeys(Class clazz)This method returns a List of Strings, each containing the field name of one of the primary keys, as defined in the ORM layer. | 
|  Map<String,Class> | getReferencesForForeignKey(Class persistableObjectClass,
                                                     String attributeName)Attempts to match the attribute name given for the class as a fk field to a reference class defined in the repository. | 
|  Map<String,DataObjectRelationship> | getRelationshipMetadata(Class persistableClass,
                                               String attributeName) | 
|  Map<String,DataObjectRelationship> | getRelationshipMetadata(Class persistableClass,
                                               String attributeName,
                                               String attributePrefix) | 
|  String | getTableName(Class<? extends PersistableBusinessObject> boClass)Returns the name of the table underlying the business object class | 
|  boolean | hasCollection(Class boClass,
                           String collectionName)Returns whether BOs of the given class have a collection defined within them with the given collection name. | 
|  boolean | hasPrimaryKeyFieldValues(Object persistableObject) | 
|  boolean | hasReference(Class boClass,
                         String referenceName)Returns whether there is a reference defined in the persistence layer with the given name. | 
|  boolean | isCollectionUpdatable(Class boClass,
                                           String collectionName) | 
|  boolean | isPersistable(Class clazz) | 
|  boolean | isReferenceUpdatable(Class boClass,
                                         String referenceName) | 
|  Map<String,Class> | listCollectionObjectTypes(Class boClass) | 
|  Map<String,Class> | listCollectionObjectTypes(PersistableBusinessObject bo) | 
|  List | listFieldNames(Class clazz) | 
|  List | listPersistableSubclasses(Class superclazz) | 
|  List | listPrimaryKeyFieldNames(Class clazz) | 
|  Map<String,Class> | listReferenceObjectFields(Class boClass)This method uses the persistence layer to determine the list of reference objects contained within this parent object. | 
|  Map<String,Class> | listReferenceObjectFields(PersistableBusinessObject bo)This method uses the persistence layer to determine the list of reference objects contained within this parent object. | 
| Method Detail | 
|---|
boolean isPersistable(Class clazz)
clazz - 
List listPrimaryKeyFieldNames(Class clazz)
clazz - Class whose primary key field names you want to list
IllegalArgumentException - if the given Class is null
ClassNotPersistableException - if the given object is of a type not described in the OJB repositoryList listFieldNames(Class clazz)
clazz - Class whose field names you want to list
IllegalArgumentException - if the given Class is null
ClassNotPersistableException - if the given object is of a type not described in the OJB repositoryList getPrimaryKeys(Class clazz)
clazz - - Class whose primary key field names are requested
IllegalArgumentException - if the given Object is null
ClassNotPersistableException - if the given object is of a type not described in the OJB repositoryboolean hasPrimaryKeyFieldValues(Object persistableObject)
persistableObject - 
IllegalArgumentException - if the given Object is null
ClassNotPersistableException - if the given object is of a type not described in the OJB repositoryObject clearPrimaryKeyFields(Object persistableObject)
persistableObject - object whose primary key fields need to be cleared
IllegalArgumentException - if the given Object is null
ClassNotPersistableException - if the given object is of a type not described in the OJB repositoryList listPersistableSubclasses(Class superclazz)
superclazz - class whose persistable subclasses (or interface whose implementors) will be returned
IllegalArgumentException - if the given class is null
Map<String,DataObjectRelationship> getRelationshipMetadata(Class persistableClass,
                                                           String attributeName,
                                                           String attributePrefix)
persistableClass - attributeName - Name of an attribute used in the relationship
IllegalArgumentException - if the given Class is null
IllegalArgumentException - if the given relationshipName is blanks
ClassNotPersistableException - if the given Class is a type not described in the OJB repository
Map<String,DataObjectRelationship> getRelationshipMetadata(Class persistableClass,
                                                           String attributeName)
String getForeignKeyFieldName(Class persistableObjectClass,
                              String attributeName,
                              String pkName)
Map<String,Class> getReferencesForForeignKey(Class persistableObjectClass,
                                             String attributeName)
persistableObjectClass - attributeName - 
Map getForeignKeysForReference(Class clazz,
                               String attributeName)
clazz - - Class that contains the named referenceattributeName - - Name of the member that is the reference you want foreign keys for
Class<? extends PersistableBusinessObjectExtension> getBusinessObjectAttributeClass(Class<? extends PersistableBusinessObject> clazz,
                                                                                    String attributeName)
clazz - - class to be examined for the attribute's classattributeName - - name of the class' attribute to be examined
Map getNestedForeignKeyMap(Class persistableObjectClass)
persistableObjectClass - 
ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(PersistableBusinessObject bo,
                                                                   String referenceName)
bo - - A populated BusinessObject descendent. Must contain an attributed named referenceName.referenceName - - The name of the field that is a reference we are analyzing.
Map<String,Class> listReferenceObjectFields(Class boClass)
boClass - Class that would like to be analyzed for reference names
Map<String,Class> listReferenceObjectFields(PersistableBusinessObject bo)
bo - BusinessObject (or subclass) instance that would like to be analyzed for reference names
Map<String,Class> listCollectionObjectTypes(Class boClass)
Map<String,Class> listCollectionObjectTypes(PersistableBusinessObject bo)
boolean hasReference(Class boClass,
                     String referenceName)
boClass - referenceName - 
boolean hasCollection(Class boClass,
                      String collectionName)
boClass - collectionName - 
boolean isReferenceUpdatable(Class boClass,
                             String referenceName)
boolean isCollectionUpdatable(Class boClass,
                              String collectionName)
Map<String,String> getInverseForeignKeysForCollection(Class boClass,
                                                      String collectionName)
boClass - collectionName - 
String getTableName(Class<? extends PersistableBusinessObject> boClass)
boClass - 
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||