public class PersistenceDaoJpa extends Object implements PersistenceDao
| Constructor and Description |
|---|
PersistenceDaoJpa() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public PersistenceDaoJpa()
public void clearCache()
clearCache in interface PersistenceDaoPersistenceDao.clearCache()public Object resolveProxy(Object o)
resolveProxy in interface PersistenceDaoPersistenceDao.resolveProxy(java.lang.Object)public void retrieveAllReferences(Object o)
retrieveAllReferences in interface PersistenceDaoPersistenceDao.retrieveAllReferences(java.lang.Object)public void retrieveReference(Object o, String referenceName)
retrieveReference in interface PersistenceDaoPersistenceDao.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 refreshprotected Collection retrieveCollectionReference(Object o, String referenceName) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException
o - the object to refreshreferenceName - the name of the reference to refreshNoSuchFieldExceptionIllegalAccessExceptionIllegalArgumentExceptionprotected 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 JoinColumnDescriptorprotected Object retrieveObjectReference(Object o, String referenceName) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InstantiationException, ClassNotFoundException
o - the object to refreshreferenceName - the name of the reference to fetchIllegalAccessExceptionIllegalArgumentExceptionNoSuchFieldExceptionClassNotFoundExceptionInstantiationExceptionprotected 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 refreshIllegalArgumentExceptionNoSuchFieldExceptionIllegalAccessExceptionInstantiationExceptionprotected 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 JoinColumnDescriptorprotected Map<String,JoinColumnDescriptor> buildJoinColumnDescriptorMap(List<JoinColumnDescriptor> joinColumnDescriptors)
joinColumnDescriptors - a List of JoinColumnDescriptorsprotected 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 fieldNoSuchFieldExceptionIllegalArgumentExceptionIllegalAccessExceptionpublic boolean isProxied(Object object)
isProxied in interface PersistenceDaoobject - the object to determine if it is a proxyPersistenceDao.isProxied(java.lang.Object)public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager - the entityManager to setCopyright © 2005–2016 The Kuali Foundation. All rights reserved.