org.broadleafcommerce.openadmin.server.dao
Class DynamicEntityDaoImpl
java.lang.Object
org.broadleafcommerce.openadmin.server.dao.BaseHibernateCriteriaDao<Serializable>
org.broadleafcommerce.openadmin.server.dao.DynamicEntityDaoImpl
- All Implemented Interfaces:
- BaseCriteriaDao<Serializable>, DynamicEntityDao
@Component(value="blDynamicEntityDao")
@Scope(value="prototype")
public class DynamicEntityDaoImpl
- extends BaseHibernateCriteriaDao<Serializable>
- implements DynamicEntityDao
- Author:
- jfischer
|
Method Summary |
protected void |
addClassToTree(Class<?> clazz,
ClassTree tree)
|
protected void |
applyForeignKeyPrecedence(ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
Map<String,FieldMetadata> mergedProperties)
|
protected void |
applyIncludesAndExcludes(String[] includeFields,
String[] excludeFields,
String prefix,
Boolean isParentExcluded,
Map<String,FieldMetadata> mergedProperties)
|
protected void |
buildComponentProperties(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
MergedPropertyType mergedPropertyType,
Map<String,FieldMetadata> fields,
String idProperty,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
String propertyName,
org.hibernate.type.Type type,
Class<?> returnedClass,
List<Class<?>> parentClasses,
Boolean isParentExcluded,
String prefix)
|
protected void |
buildEntityProperties(Map<String,FieldMetadata> fields,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
String propertyName,
Class<?> returnedClass,
Class<?> targetClass,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
|
protected void |
buildProperties(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
MergedPropertyType mergedPropertyType,
Map<String,FieldMetadata> presentationAttributes,
List<org.hibernate.mapping.Property> componentProperties,
Map<String,FieldMetadata> fields,
List<String> propertyNames,
List<org.hibernate.type.Type> propertyTypes,
String idProperty,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
|
protected void |
buildPropertiesFromPolymorphicEntities(Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
Map<String,FieldMetadata> mergedProperties,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
|
protected void |
buildProperty(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
List<org.hibernate.mapping.Property> componentProperties,
Map<String,FieldMetadata> fields,
String idProperty,
String prefix,
String propertyName,
org.hibernate.type.Type type,
boolean isPropertyForeignKey,
int additionalForeignKeyIndexPosition,
FieldMetadata presentationAttribute,
SupportedFieldType explicitType,
Class<?> returnedClass)
|
void |
clear()
|
protected void |
createClassTreeFromAnnotation(Class<?> clazz,
ClassTree myTree)
|
void |
detach(Serializable entity)
|
protected int |
findAdditionalForeignKeyIndex(ForeignKey[] additionalForeignFields,
String prefix,
String propertyName)
|
void |
flush()
|
Field[] |
getAllFields(Class<?> targetClass)
|
Class<?>[] |
getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass)
|
protected String |
getCacheKey(ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
Class<?> clazz,
String configurationKey,
Boolean isParentExcluded)
|
ClassTree |
getClassTree(Class<?>[] polymorphicClasses)
|
ClassTree |
getClassTreeFromCeiling(Class<?> ceilingClass)
|
EJB3ConfigurationDao |
getEjb3ConfigurationDao()
|
Class<? extends Serializable> |
getEntityClass()
|
EntityConfiguration |
getEntityConfiguration()
|
FieldManager |
getFieldManager()
|
Map<String,Object> |
getIdMetadata(Class<?> entityClass)
|
Map<String,FieldMetadata> |
getMergedProperties(String ceilingEntityFullyQualifiedClassname,
Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String prefix)
|
protected Map<String,FieldMetadata> |
getMergedPropertiesRecursively(String ceilingEntityFullyQualifiedClassname,
Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
|
org.hibernate.mapping.PersistentClass |
getPersistentClass(String targetClassName)
Get the Hibernate PersistentClass instance associated with the fully-qualified
class name. |
protected Map<String,FieldMetadata> |
getPropertiesForEntityClass(Class<?> targetClass,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
|
Map<String,FieldMetadata> |
getPropertiesForPrimitiveClass(String propertyName,
String friendlyPropertyName,
Class<?> targetClass,
Class<?> parentClass,
MergedPropertyType mergedPropertyType)
|
List<String> |
getPropertyNames(Class<?> entityClass)
|
List<org.hibernate.type.Type> |
getPropertyTypes(Class<?> entityClass)
|
protected org.hibernate.SessionFactory |
getSessionFactory()
|
Map<String,FieldMetadata> |
getSimpleMergedProperties(String entityName,
PersistencePerspective persistencePerspective)
|
javax.persistence.EntityManager |
getStandardEntityManager()
|
Serializable |
merge(Serializable entity)
|
protected String |
pad(String s,
int length,
char pad)
|
Serializable |
persist(Serializable entity)
|
void |
refresh(Serializable entity)
|
void |
remove(Serializable entity)
|
Serializable |
retrieve(Class<?> entityClass,
Object primaryKey)
|
void |
setEjb3ConfigurationDao(EJB3ConfigurationDao ejb3ConfigurationDao)
|
void |
setEntityConfiguration(EntityConfiguration entityConfiguration)
|
protected boolean |
setExcludedBasedOnShowIfProperty(FieldMetadata fieldMetadata)
|
void |
setStandardEntityManager(javax.persistence.EntityManager entityManager)
|
Class<?>[] |
sortEntities(Class<?> ceilingClass,
List<Class<?>> entities)
|
protected boolean |
testForeignProperty(ForeignKey foreignField,
String prefix,
String propertyName)
|
Boolean |
testPropertyInclusion(FieldMetadata presentationAttribute)
|
protected Boolean |
testPropertyRecursion(String prefix,
List<Class<?>> parentClasses,
String propertyName,
Class<?> targetClass,
String ceilingEntityFullyQualifiedClassname)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOCK_OBJECT
protected static final Object LOCK_OBJECT
METADATA_CACHE
protected static final Map<String,Map<String,FieldMetadata>> METADATA_CACHE
POLYMORPHIC_ENTITY_CACHE
protected static final Map<Class<?>,Class<?>[]> POLYMORPHIC_ENTITY_CACHE
standardEntityManager
protected javax.persistence.EntityManager standardEntityManager
metadata
protected Metadata metadata
ejb3ConfigurationDao
protected EJB3ConfigurationDao ejb3ConfigurationDao
appConfigurationRemoteService
protected AppConfigurationService appConfigurationRemoteService
entityConfiguration
protected EntityConfiguration entityConfiguration
DynamicEntityDaoImpl
public DynamicEntityDaoImpl()
getEntityClass
public Class<? extends Serializable> getEntityClass()
- Specified by:
getEntityClass in interface BaseCriteriaDao<Serializable>- Specified by:
getEntityClass in class BaseHibernateCriteriaDao<Serializable>
persist
public Serializable persist(Serializable entity)
- Specified by:
persist in interface DynamicEntityDao
merge
public Serializable merge(Serializable entity)
- Specified by:
merge in interface DynamicEntityDao
flush
public void flush()
- Specified by:
flush in interface DynamicEntityDao
detach
public void detach(Serializable entity)
- Specified by:
detach in interface DynamicEntityDao
refresh
public void refresh(Serializable entity)
- Specified by:
refresh in interface DynamicEntityDao
retrieve
public Serializable retrieve(Class<?> entityClass,
Object primaryKey)
- Specified by:
retrieve in interface DynamicEntityDao
remove
public void remove(Serializable entity)
- Specified by:
remove in interface DynamicEntityDao
clear
public void clear()
- Specified by:
clear in interface DynamicEntityDao
getPersistentClass
public org.hibernate.mapping.PersistentClass getPersistentClass(String targetClassName)
- Description copied from interface:
DynamicEntityDao
- Get the Hibernate PersistentClass instance associated with the fully-qualified
class name. Will return null if no persistent class is associated with this name.
- Specified by:
getPersistentClass in interface DynamicEntityDao
- Returns:
- The PersistentClass instance
getAllPolymorphicEntitiesFromCeiling
public Class<?>[] getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass)
- Specified by:
getAllPolymorphicEntitiesFromCeiling in interface DynamicEntityDao
sortEntities
public Class<?>[] sortEntities(Class<?> ceilingClass,
List<Class<?>> entities)
addClassToTree
protected void addClassToTree(Class<?> clazz,
ClassTree tree)
createClassTreeFromAnnotation
protected void createClassTreeFromAnnotation(Class<?> clazz,
ClassTree myTree)
getClassTree
public ClassTree getClassTree(Class<?>[] polymorphicClasses)
- Specified by:
getClassTree in interface DynamicEntityDao
getClassTreeFromCeiling
public ClassTree getClassTreeFromCeiling(Class<?> ceilingClass)
- Specified by:
getClassTreeFromCeiling in interface DynamicEntityDao
getSimpleMergedProperties
public Map<String,FieldMetadata> getSimpleMergedProperties(String entityName,
PersistencePerspective persistencePerspective)
- Specified by:
getSimpleMergedProperties in interface DynamicEntityDao
getMergedProperties
public Map<String,FieldMetadata> getMergedProperties(String ceilingEntityFullyQualifiedClassname,
Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String prefix)
- Specified by:
getMergedProperties in interface DynamicEntityDao
getMergedPropertiesRecursively
protected Map<String,FieldMetadata> getMergedPropertiesRecursively(String ceilingEntityFullyQualifiedClassname,
Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
applyForeignKeyPrecedence
protected void applyForeignKeyPrecedence(ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
Map<String,FieldMetadata> mergedProperties)
applyIncludesAndExcludes
protected void applyIncludesAndExcludes(String[] includeFields,
String[] excludeFields,
String prefix,
Boolean isParentExcluded,
Map<String,FieldMetadata> mergedProperties)
pad
protected String pad(String s,
int length,
char pad)
getCacheKey
protected String getCacheKey(ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
Class<?> clazz,
String configurationKey,
Boolean isParentExcluded)
buildPropertiesFromPolymorphicEntities
protected void buildPropertiesFromPolymorphicEntities(Class<?>[] entities,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
Map<String,FieldMetadata> mergedProperties,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
getAllFields
public Field[] getAllFields(Class<?> targetClass)
- Specified by:
getAllFields in interface DynamicEntityDao
getPropertiesForPrimitiveClass
public Map<String,FieldMetadata> getPropertiesForPrimitiveClass(String propertyName,
String friendlyPropertyName,
Class<?> targetClass,
Class<?> parentClass,
MergedPropertyType mergedPropertyType)
- Specified by:
getPropertiesForPrimitiveClass in interface DynamicEntityDao
getSessionFactory
protected org.hibernate.SessionFactory getSessionFactory()
getIdMetadata
public Map<String,Object> getIdMetadata(Class<?> entityClass)
- Specified by:
getIdMetadata in interface DynamicEntityDao
getPropertyNames
public List<String> getPropertyNames(Class<?> entityClass)
- Specified by:
getPropertyNames in interface DynamicEntityDao
getPropertyTypes
public List<org.hibernate.type.Type> getPropertyTypes(Class<?> entityClass)
- Specified by:
getPropertyTypes in interface DynamicEntityDao
getPropertiesForEntityClass
protected Map<String,FieldMetadata> getPropertiesForEntityClass(Class<?> targetClass,
ForeignKey foreignField,
String[] additionalNonPersistentProperties,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
buildProperties
protected void buildProperties(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
MergedPropertyType mergedPropertyType,
Map<String,FieldMetadata> presentationAttributes,
List<org.hibernate.mapping.Property> componentProperties,
Map<String,FieldMetadata> fields,
List<String> propertyNames,
List<org.hibernate.type.Type> propertyTypes,
String idProperty,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
setExcludedBasedOnShowIfProperty
protected boolean setExcludedBasedOnShowIfProperty(FieldMetadata fieldMetadata)
buildProperty
protected void buildProperty(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
MergedPropertyType mergedPropertyType,
List<org.hibernate.mapping.Property> componentProperties,
Map<String,FieldMetadata> fields,
String idProperty,
String prefix,
String propertyName,
org.hibernate.type.Type type,
boolean isPropertyForeignKey,
int additionalForeignKeyIndexPosition,
FieldMetadata presentationAttribute,
SupportedFieldType explicitType,
Class<?> returnedClass)
testPropertyRecursion
protected Boolean testPropertyRecursion(String prefix,
List<Class<?>> parentClasses,
String propertyName,
Class<?> targetClass,
String ceilingEntityFullyQualifiedClassname)
testPropertyInclusion
public Boolean testPropertyInclusion(FieldMetadata presentationAttribute)
testForeignProperty
protected boolean testForeignProperty(ForeignKey foreignField,
String prefix,
String propertyName)
findAdditionalForeignKeyIndex
protected int findAdditionalForeignKeyIndex(ForeignKey[] additionalForeignFields,
String prefix,
String propertyName)
buildEntityProperties
protected void buildEntityProperties(Map<String,FieldMetadata> fields,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
String propertyName,
Class<?> returnedClass,
Class<?> targetClass,
List<Class<?>> parentClasses,
String prefix,
Boolean isParentExcluded)
buildComponentProperties
protected void buildComponentProperties(Class<?> targetClass,
ForeignKey foreignField,
ForeignKey[] additionalForeignFields,
String[] additionalNonPersistentProperties,
MergedPropertyType mergedPropertyType,
Map<String,FieldMetadata> fields,
String idProperty,
Boolean populateManyToOneFields,
String[] includeFields,
String[] excludeFields,
String configurationKey,
String ceilingEntityFullyQualifiedClassname,
String propertyName,
org.hibernate.type.Type type,
Class<?> returnedClass,
List<Class<?>> parentClasses,
Boolean isParentExcluded,
String prefix)
getStandardEntityManager
public javax.persistence.EntityManager getStandardEntityManager()
- Specified by:
getStandardEntityManager in interface BaseCriteriaDao<Serializable>- Specified by:
getStandardEntityManager in interface DynamicEntityDao- Specified by:
getStandardEntityManager in class BaseHibernateCriteriaDao<Serializable>
setStandardEntityManager
public void setStandardEntityManager(javax.persistence.EntityManager entityManager)
- Specified by:
setStandardEntityManager in interface DynamicEntityDao
getEjb3ConfigurationDao
public EJB3ConfigurationDao getEjb3ConfigurationDao()
setEjb3ConfigurationDao
public void setEjb3ConfigurationDao(EJB3ConfigurationDao ejb3ConfigurationDao)
getFieldManager
public FieldManager getFieldManager()
- Specified by:
getFieldManager in interface DynamicEntityDao
getEntityConfiguration
public EntityConfiguration getEntityConfiguration()
- Specified by:
getEntityConfiguration in interface DynamicEntityDao
setEntityConfiguration
public void setEntityConfiguration(EntityConfiguration entityConfiguration)
- Specified by:
setEntityConfiguration in interface DynamicEntityDao
Copyright © 2013. All Rights Reserved.