|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.dao.impl.PersistenceDaoJpa
public class PersistenceDaoJpa
Constructor Summary | |
---|---|
PersistenceDaoJpa()
|
Method Summary | |
---|---|
protected Object |
buildForeignKeyObject(Object o,
EntityDescriptor localEntityDescriptor,
ObjectDescriptor objectDescriptor)
Builds a foreign key object for the relationship given by the foreignKeyClass and the objectDescriptor |
protected Map<String,JoinColumnDescriptor> |
buildJoinColumnDescriptorMap(List<JoinColumnDescriptor> joinColumnDescriptors)
Turns a List of JoinColumnDescriptors and maps them by their name |
protected Object |
buildSingleKeyForeignKeyObject(Object o,
String singleForeignKeyFieldName)
Builds a foreign key, where that foreign key has a single field |
void |
clearCache()
|
javax.persistence.EntityManager |
getEntityManager()
|
protected String |
getForeignKeyPropertyForKey(String foreignKey,
EntityDescriptor localEntityDescriptor,
EntityDescriptor foreignEntityDescriptor,
Map<String,JoinColumnDescriptor> joinColumnDescriptors)
Finds the correct foreign key property which corresponds to the given key |
protected String |
getForeignKeyPropertyForKeyWithPossibleInverse(String foreignKey,
EntityDescriptor localEntityDescriptor,
EntityDescriptor foreignEntityDescriptor,
CollectionDescriptor collectionDescriptor)
Finds the correct foreign key property which corresponds to the given key |
boolean |
isProxied(Object object)
True if object is an instance of HibernateProxy, false otherwise |
protected boolean |
isReferenceCollection(Object o,
String referenceName)
Determines if the reference on the given object represents a collection or not |
Object |
resolveProxy(Object o)
|
void |
retrieveAllReferences(Object o)
|
protected Collection |
retrieveCollectionReference(Object o,
String referenceName)
This method fetches a collection to refresh a reference |
protected Object |
retrieveObjectReference(Object o,
String referenceName)
Fetches an object reference |
void |
retrieveReference(Object o,
String referenceName)
|
void |
setEntityManager(javax.persistence.EntityManager entityManager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistenceDaoJpa()
Method Detail |
---|
public void clearCache()
clearCache
in interface PersistenceDao
PersistenceDao.clearCache()
public Object resolveProxy(Object o)
resolveProxy
in interface PersistenceDao
PersistenceDao.resolveProxy(java.lang.Object)
public void retrieveAllReferences(Object o)
retrieveAllReferences
in interface PersistenceDao
PersistenceDao.retrieveAllReferences(java.lang.Object)
public void retrieveReference(Object o, String referenceName)
retrieveReference
in interface PersistenceDao
PersistenceDao.retrieveReference(java.lang.Object, java.lang.String)
protected boolean isReferenceCollection(Object o, String referenceName)
o
- the object which is to be refreshedreferenceName
- the name of the reference to refresh
protected Collection retrieveCollectionReference(Object o, String referenceName) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
o
- the object to refreshreferenceName
- the name of the reference to refresh
NoSuchFieldException
IllegalAccessException
IllegalArgumentException
protected String getForeignKeyPropertyForKeyWithPossibleInverse(String foreignKey, EntityDescriptor localEntityDescriptor, EntityDescriptor foreignEntityDescriptor, CollectionDescriptor collectionDescriptor)
foreignKey
- the name of the key we want to find the proper foreign name forlocalEntityDescriptor
- the descriptor of the entity that key is onforeignEntityDescriptor
- the descriptor of the entity we're trying to retrievejoinColumnDescriptors
- a Map of the JoinColumnDescriptors that describe the relationship from the local entity's point of view, keyed by the column name of the JoinColumnDescriptor
protected Object retrieveObjectReference(Object o, String referenceName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InstantiationException, ClassNotFoundException
o
- the object to refreshreferenceName
- the name of the reference to fetch
IllegalAccessException
IllegalArgumentException
NoSuchFieldException
ClassNotFoundException
InstantiationException
protected Object buildForeignKeyObject(Object o, EntityDescriptor localEntityDescriptor, ObjectDescriptor objectDescriptor) throws IllegalArgumentException, NoSuchFieldException, IllegalAccessException, InstantiationException
o
- the object to refreshlocalEntityDescriptor
- the entity descriptor for that objectobjectDescriptor
- the object descriptor for the relationship to refresh
IllegalArgumentException
NoSuchFieldException
IllegalAccessException
InstantiationException
protected String getForeignKeyPropertyForKey(String foreignKey, EntityDescriptor localEntityDescriptor, EntityDescriptor foreignEntityDescriptor, Map<String,JoinColumnDescriptor> joinColumnDescriptors)
foreignKey
- the name of the key we want to find the proper foreign name forlocalEntityDescriptor
- the descriptor of the entity that key is onforeignEntityDescriptor
- the descriptor of the entity we're trying to retrievejoinColumnDescriptors
- a Map of the JoinColumnDescriptors that describe the relationship from the local entity's point of view, keyed by the column name of the JoinColumnDescriptor
protected Map<String,JoinColumnDescriptor> buildJoinColumnDescriptorMap(List<JoinColumnDescriptor> joinColumnDescriptors)
joinColumnDescriptors
- a List of JoinColumnDescriptors
protected Object buildSingleKeyForeignKeyObject(Object o, String singleForeignKeyFieldName) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
o
- the object to get the foreign key value fromsingleForeignKeyFieldName
- the name of the foreign key field
NoSuchFieldException
IllegalArgumentException
IllegalAccessException
public boolean isProxied(Object object)
isProxied
in interface PersistenceDao
object
- the object to determine if it is a proxy
PersistenceDao.isProxied(java.lang.Object)
public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager
- the entityManager to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |