|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.service.impl.PersistenceServiceStructureImplBase org.kuali.rice.krad.service.impl.PersistenceServiceImplBase org.kuali.rice.krad.service.impl.PersistenceStructureServiceJpaImpl
public class PersistenceStructureServiceJpaImpl
Field Summary | |
---|---|
static Map<Class,Class> |
referenceConversionMap
special case when the attributeClass passed in doesnt match the class of the reference-descriptor as defined in ojb-repository. |
Constructor Summary | |
---|---|
PersistenceStructureServiceJpaImpl()
|
Method Summary | |
---|---|
Object |
clearPrimaryKeyFields(Object persistableObject)
|
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 |
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)
|
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. |
Methods inherited from class org.kuali.rice.krad.service.impl.PersistenceServiceImplBase |
---|
getPrimaryKeyFieldValues, getPrimaryKeyFieldValues |
Methods inherited from class org.kuali.rice.krad.service.impl.PersistenceServiceStructureImplBase |
---|
getBusinessObjectAttributeClass, getClassDescriptor, getDescriptorRepository, isJpaEnabledForKradClass, listPrimaryKeyFieldNames |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.kuali.rice.krad.service.PersistenceStructureService |
---|
getBusinessObjectAttributeClass, listPrimaryKeyFieldNames |
Field Detail |
---|
public static Map<Class,Class> referenceConversionMap
Constructor Detail |
---|
public PersistenceStructureServiceJpaImpl()
Method Detail |
---|
public boolean isPersistable(Class clazz)
isPersistable
in interface PersistenceStructureService
org.kuali.rice.krad.service.PersistenceService#isPersistable(java.lang.Class)
public List getPrimaryKeys(Class clazz)
PersistenceStructureService
getPrimaryKeys
in interface PersistenceStructureService
clazz
- - Class whose primary key field names are requested
org.kuali.rice.krad.service.PersistenceService#getPrimaryKeys(java.lang.Class)
public List listFieldNames(Class clazz)
listFieldNames
in interface PersistenceStructureService
clazz
- Class whose field names you want to list
org.kuali.rice.krad.service.PersistenceMetadataExplorerService#listFieldNames(java.lang.Class)
public Object clearPrimaryKeyFields(Object persistableObject)
clearPrimaryKeyFields
in interface PersistenceStructureService
persistableObject
- object whose primary key fields need to be cleared
org.kuali.rice.krad.service.PersistenceMetadataService#clearPrimaryKeyFields(java.lang.Object)
public List listPersistableSubclasses(Class superclazz)
listPersistableSubclasses
in interface PersistenceStructureService
superclazz
- class whose persistable subclasses (or interface whose implementors) will be returned
org.kuali.rice.krad.service.PersistenceMetadataExplorerService#listPersistableSubclasses(java.lang.Class)
public Map<String,DataObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName, String attributePrefix)
getRelationshipMetadata
in interface PersistenceStructureService
attributeName
- Name of an attribute used in the relationship
org.kuali.rice.krad.service.PersistenceService#getRelationshipMetadata(java.lang.Class,
java.lang.String)
public Map<String,DataObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName)
getRelationshipMetadata
in interface PersistenceStructureService
public String getForeignKeyFieldName(Class persistableObjectClass, String attributeName, String pkName)
getForeignKeyFieldName
in interface PersistenceStructureService
org.kuali.rice.krad.service.PersistenceService#getForeignKeyFieldName(java.lang.Object,
java.lang.String, java.lang.String)
public Map getReferencesForForeignKey(Class persistableObjectClass, String attributeName)
PersistenceStructureService
getReferencesForForeignKey
in interface PersistenceStructureService
org.kuali.rice.krad.service.PersistenceService#getReferencesForForeignKey(java.lang.Class,
java.lang.String)
public Map getForeignKeysForReference(Class clazz, String attributeName)
PersistenceStructureService
getForeignKeysForReference
in interface PersistenceStructureService
clazz
- - Class that contains the named referenceattributeName
- - Name of the member that is the reference you want foreign keys for
The Map structure is: Key(String fkFieldName) =>
Value(String pkFieldName) NOTE that this implementation depends on
the ordering of foreign-key elements in the ojb-repository matching
the ordering of primary-key declarations of the class on the other
side of the relationship. This is done because: 1. The current
version of OJB requires you to declare all of these things in the
correct (and matching) order in the ojb-repository file for it to
work at all. 2. There is no other way to match a given foreign-key
reference to its corresponding primary-key on the opposing side of
the relationship. Yes, this is a crummy way to do it, but OJB doesnt
provide explicit matches of foreign-keys to primary keys, and always
assumes that foreign-keys map to primary keys on the other object,
and never to a set of candidate keys, or any other column.
public Map<String,String> getInverseForeignKeysForCollection(Class boClass, String collectionName)
PersistenceStructureService
getInverseForeignKeysForCollection
in interface PersistenceStructureService
public Map getNestedForeignKeyMap(Class persistableObjectClass)
PersistenceStructureService
getNestedForeignKeyMap
in interface PersistenceStructureService
org.kuali.rice.krad.service.PersistenceService#getNestedForeignKeyMap(java.lang.Class)
public boolean hasPrimaryKeyFieldValues(Object persistableObject)
hasPrimaryKeyFieldValues
in interface PersistenceStructureService
org.kuali.rice.krad.service.PersistenceMetadataService#hasPrimaryKeyFieldValues(java.lang.Object)
public ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(PersistableBusinessObject bo, String referenceName)
PersistenceStructureService
getForeignKeyFieldsPopulationState
in interface PersistenceStructureService
bo
- - A populated BusinessObject descendent. Must contain an attributed named referenceName.referenceName
- - The name of the field that is a reference we are analyzing.
org.kuali.rice.krad.service.PersistenceService#getForeignKeyFieldsPopulationState(org.kuali.rice.krad.bo.BusinessObject,
java.lang.String)
public Map<String,Class> listReferenceObjectFields(Class boClass)
PersistenceStructureService
listReferenceObjectFields
in interface PersistenceStructureService
boClass
- Class that would like to be analyzed for reference names
org.kuali.rice.krad.service.PersistenceStructureService#listReferenceObjectFieldNames(java.lang.Class)
public Map<String,Class> listCollectionObjectTypes(Class boClass)
listCollectionObjectTypes
in interface PersistenceStructureService
public Map<String,Class> listCollectionObjectTypes(PersistableBusinessObject bo)
listCollectionObjectTypes
in interface PersistenceStructureService
public Map<String,Class> listReferenceObjectFields(PersistableBusinessObject bo)
PersistenceStructureService
listReferenceObjectFields
in interface PersistenceStructureService
bo
- BusinessObject (or subclass) instance that would like to be analyzed for reference names
org.kuali.rice.krad.service.PersistenceStructureService#listReferenceObjectFieldNames(org.kuali.rice.krad.bo.BusinessObject)
public boolean isReferenceUpdatable(Class boClass, String referenceName)
isReferenceUpdatable
in interface PersistenceStructureService
public boolean isCollectionUpdatable(Class boClass, String collectionName)
isCollectionUpdatable
in interface PersistenceStructureService
public boolean hasCollection(Class boClass, String collectionName)
PersistenceStructureService
hasCollection
in interface PersistenceStructureService
public boolean hasReference(Class boClass, String referenceName)
PersistenceStructureService
hasReference
in interface PersistenceStructureService
public String getTableName(Class<? extends PersistableBusinessObject> boClass)
PersistenceStructureService
getTableName
in interface PersistenceStructureService
PersistenceStructureService.getTableName(java.lang.Class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |