org.kuali.rice.krad.service.impl
Class PersistenceStructureServiceOjbImpl

java.lang.Object
  extended by org.kuali.rice.krad.service.impl.PersistenceServiceStructureImplBase
      extended by org.kuali.rice.krad.service.impl.PersistenceServiceImplBase
          extended by org.kuali.rice.krad.service.impl.PersistenceStructureServiceOjbImpl
All Implemented Interfaces:
org.kuali.rice.krad.service.PersistenceStructureService

public class PersistenceStructureServiceOjbImpl
extends PersistenceServiceImplBase
implements org.kuali.rice.krad.service.PersistenceStructureService


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
PersistenceStructureServiceOjbImpl()
           
 
Method Summary
 Object clearPrimaryKeyFields(Object persistableObject)
           
 String getForeignKeyFieldName(Class persistableObjectClass, String attributeName, String pkName)
           
 org.kuali.rice.krad.util.ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(org.kuali.rice.krad.bo.PersistableBusinessObject bo, String referenceName)
           
 Map getForeignKeysForReference(Class clazz, String attributeName)
           
 Map<String,String> getInverseForeignKeysForCollection(Class boClass, String collectionName)
           
 Map getNestedForeignKeyMap(Class persistableObjectClass)
           
 org.kuali.rice.krad.service.PersistenceStructureService getPersistenceStructureServiceJpa()
           
 List getPrimaryKeys(Class clazz)
           
 Map getReferencesForForeignKey(Class persistableObjectClass, String attributeName)
           
 Map<String,org.kuali.rice.krad.bo.BusinessObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName)
           
 Map<String,org.kuali.rice.krad.bo.BusinessObjectRelationship> getRelationshipMetadata(Class persistableClass, String attributeName, String attributePrefix)
           
 String getTableName(Class<? extends org.kuali.rice.krad.bo.PersistableBusinessObject> boClass)
          This overridden method ...
 boolean hasCollection(Class boClass, String collectionName)
           
 boolean hasPrimaryKeyFieldValues(Object persistableObject)
           
 boolean hasReference(Class boClass, String referenceName)
           
 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(org.kuali.rice.krad.bo.PersistableBusinessObject bo)
           
 List listFieldNames(Class clazz)
           
 List listPersistableSubclasses(Class superclazz)
           
 Map<String,Class> listReferenceObjectFields(Class boClass)
           
 Map<String,Class> listReferenceObjectFields(org.kuali.rice.krad.bo.PersistableBusinessObject bo)
           
 void setPersistenceStructureServiceJpa(org.kuali.rice.krad.service.PersistenceStructureService persistenceStructureServiceJpa)
           
 
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

referenceConversionMap

public 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. Currently the only case of this happening is ObjectCode vs. ObjectCodeCurrent. NOTE: This method makes no real sense and is a product of a hack introduced by KFS for an unknown reason. If you find yourself using this map stop and go do something else.

Constructor Detail

PersistenceStructureServiceOjbImpl

public PersistenceStructureServiceOjbImpl()
Method Detail

getPersistenceStructureServiceJpa

public org.kuali.rice.krad.service.PersistenceStructureService getPersistenceStructureServiceJpa()

setPersistenceStructureServiceJpa

public void setPersistenceStructureServiceJpa(org.kuali.rice.krad.service.PersistenceStructureService persistenceStructureServiceJpa)

isPersistable

public boolean isPersistable(Class clazz)
Specified by:
isPersistable in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#isPersistable(java.lang.Class)

getPrimaryKeys

public List getPrimaryKeys(Class clazz)
Specified by:
getPrimaryKeys in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getPrimaryKeys(java.lang.Class)

listFieldNames

public List listFieldNames(Class clazz)
Specified by:
listFieldNames in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceMetadataExplorerService#listFieldNames(java.lang.Class)

clearPrimaryKeyFields

public Object clearPrimaryKeyFields(Object persistableObject)
Specified by:
clearPrimaryKeyFields in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceMetadataService#clearPrimaryKeyFields(java.lang.Object)

listPersistableSubclasses

public List listPersistableSubclasses(Class superclazz)
Specified by:
listPersistableSubclasses in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceMetadataExplorerService#listPersistableSubclasses(java.lang.Class)

getRelationshipMetadata

public Map<String,org.kuali.rice.krad.bo.BusinessObjectRelationship> getRelationshipMetadata(Class persistableClass,
                                                                                             String attributeName,
                                                                                             String attributePrefix)
Specified by:
getRelationshipMetadata in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getRelationshipMetadata(java.lang.Class, java.lang.String)

getRelationshipMetadata

public Map<String,org.kuali.rice.krad.bo.BusinessObjectRelationship> getRelationshipMetadata(Class persistableClass,
                                                                                             String attributeName)
Specified by:
getRelationshipMetadata in interface org.kuali.rice.krad.service.PersistenceStructureService

getForeignKeyFieldName

public String getForeignKeyFieldName(Class persistableObjectClass,
                                     String attributeName,
                                     String pkName)
Specified by:
getForeignKeyFieldName in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getForeignKeyFieldName(java.lang.Object, java.lang.String, java.lang.String)

getReferencesForForeignKey

public Map getReferencesForForeignKey(Class persistableObjectClass,
                                      String attributeName)
Specified by:
getReferencesForForeignKey in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getReferencesForForeignKey(java.lang.Class, java.lang.String)

getForeignKeysForReference

public Map getForeignKeysForReference(Class clazz,
                                      String attributeName)
Specified by:
getForeignKeysForReference in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
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.

getInverseForeignKeysForCollection

public Map<String,String> getInverseForeignKeysForCollection(Class boClass,
                                                             String collectionName)
Specified by:
getInverseForeignKeysForCollection in interface org.kuali.rice.krad.service.PersistenceStructureService

getNestedForeignKeyMap

public Map getNestedForeignKeyMap(Class persistableObjectClass)
Specified by:
getNestedForeignKeyMap in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getNestedForeignKeyMap(java.lang.Class)

hasPrimaryKeyFieldValues

public boolean hasPrimaryKeyFieldValues(Object persistableObject)
Specified by:
hasPrimaryKeyFieldValues in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceMetadataService#hasPrimaryKeyFieldValues(java.lang.Object)

getForeignKeyFieldsPopulationState

public org.kuali.rice.krad.util.ForeignKeyFieldsPopulationState getForeignKeyFieldsPopulationState(org.kuali.rice.krad.bo.PersistableBusinessObject bo,
                                                                                                   String referenceName)
Specified by:
getForeignKeyFieldsPopulationState in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceService#getForeignKeyFieldsPopulationState(org.kuali.rice.krad.bo.BusinessObject, java.lang.String)

listReferenceObjectFields

public Map<String,Class> listReferenceObjectFields(Class boClass)
Specified by:
listReferenceObjectFields in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceStructureService#listReferenceObjectFieldNames(java.lang.Class)

listCollectionObjectTypes

public Map<String,Class> listCollectionObjectTypes(Class boClass)
Specified by:
listCollectionObjectTypes in interface org.kuali.rice.krad.service.PersistenceStructureService

listCollectionObjectTypes

public Map<String,Class> listCollectionObjectTypes(org.kuali.rice.krad.bo.PersistableBusinessObject bo)
Specified by:
listCollectionObjectTypes in interface org.kuali.rice.krad.service.PersistenceStructureService

listReferenceObjectFields

public Map<String,Class> listReferenceObjectFields(org.kuali.rice.krad.bo.PersistableBusinessObject bo)
Specified by:
listReferenceObjectFields in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
org.kuali.rice.krad.service.PersistenceStructureService#listReferenceObjectFieldNames(org.kuali.rice.krad.bo.BusinessObject)

isReferenceUpdatable

public boolean isReferenceUpdatable(Class boClass,
                                    String referenceName)
Specified by:
isReferenceUpdatable in interface org.kuali.rice.krad.service.PersistenceStructureService

isCollectionUpdatable

public boolean isCollectionUpdatable(Class boClass,
                                     String collectionName)
Specified by:
isCollectionUpdatable in interface org.kuali.rice.krad.service.PersistenceStructureService

hasCollection

public boolean hasCollection(Class boClass,
                             String collectionName)
Specified by:
hasCollection in interface org.kuali.rice.krad.service.PersistenceStructureService

hasReference

public boolean hasReference(Class boClass,
                            String referenceName)
Specified by:
hasReference in interface org.kuali.rice.krad.service.PersistenceStructureService

getTableName

public String getTableName(Class<? extends org.kuali.rice.krad.bo.PersistableBusinessObject> boClass)
This overridden method ...

Specified by:
getTableName in interface org.kuali.rice.krad.service.PersistenceStructureService
See Also:
PersistenceStructureService.getTableName(java.lang.Class)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.