public class DynamicDaoHelperImpl extends Object implements DynamicDaoHelper
Modifier and Type | Field and Description |
---|---|
static String |
HIBERNATE_PROXY |
static String |
JAVASSIST_PROXY_KEY_PHRASE |
static Object |
LOCK_OBJECT |
static Map<Class<?>,Class<?>[]> |
POLYMORPHIC_ENTITY_CACHE |
static Map<Class<?>,Class<?>[]> |
POLYMORPHIC_ENTITY_CACHE_WO_EXCLUSIONS |
Constructor and Description |
---|
DynamicDaoHelperImpl() |
Modifier and Type | Method and Description |
---|---|
Class<?>[] |
getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass,
boolean includeUnqualifiedPolymorphicEntities,
boolean useCache)
Get all the polymorphic types known to Hibernate for the ceiling class provided.
|
protected Class<?>[] |
getCachedPolymorphicEntityList(Map<Class<?>,Class<?>[]> polymorphicEntityCache,
Class<?> ceilingClass) |
Serializable |
getIdentifier(Object entity)
The value of the Hibernate registered identifier property for the entity instance.
|
Field |
getIdField(Class<?> clazz)
The Field that represents the Hibernate registered identifier property for the entity class.
|
Map<String,Object> |
getIdMetadata(Class<?> entityClass,
javax.persistence.EntityManager entityManager)
Retrieve information about the id property for the entity class and the data type of that property.
|
static Class<?> |
getNonProxyImplementationClassIfNecessary(Class<?> candidate) |
List<String> |
getPropertyNames(Class<?> entityClass)
Retrieve the list of property names known to Hibernate for the entity class.
|
List<org.hibernate.type.Type> |
getPropertyTypes(Class<?> entityClass)
Retrieve the list of property types (
Type known to Hibernate for the entity class. |
Class<?>[] |
getUpDownInheritance(Class<?> testClass,
boolean includeUnqualifiedPolymorphicEntities,
boolean useCache)
Retrieve a complete polymorphic type list for an entity class, even if the entity class is not the ceiling class (or
root of the hierarchy).
|
boolean |
isExcludeClassFromPolymorphism(Class<?> clazz)
Discover is a class should be excluded from a polymorphic list.
|
Class<?>[] |
sortEntities(Class<?> ceilingClass,
List<Class<?>> entities)
Sort a list of polymorphic types with the most derived appearing first.
|
public static final String HIBERNATE_PROXY
public static final Object LOCK_OBJECT
public static final Map<Class<?>,Class<?>[]> POLYMORPHIC_ENTITY_CACHE_WO_EXCLUSIONS
public static final String JAVASSIST_PROXY_KEY_PHRASE
public static Class<?> getNonProxyImplementationClassIfNecessary(Class<?> candidate)
public Class<?>[] getAllPolymorphicEntitiesFromCeiling(Class<?> ceilingClass, boolean includeUnqualifiedPolymorphicEntities, boolean useCache)
DynamicDaoHelper
getAllPolymorphicEntitiesFromCeiling
in interface DynamicDaoHelper
includeUnqualifiedPolymorphicEntities
- Some entities may be excluded from polymorphism (Abstract class and those marked with AdminPresentationClass.excludeFromPolymorphism()
). Override that exlusion behavior.useCache
- Cache the polymorphic types discovered for the ceilingClass.protected Class<?>[] getCachedPolymorphicEntityList(Map<Class<?>,Class<?>[]> polymorphicEntityCache, Class<?> ceilingClass)
public Class<?>[] getUpDownInheritance(Class<?> testClass, boolean includeUnqualifiedPolymorphicEntities, boolean useCache)
DynamicDaoHelper
getUpDownInheritance
in interface DynamicDaoHelper
testClass
- An entity class to look for polymorphic types both above and belowincludeUnqualifiedPolymorphicEntities
- Some entities may be excluded from polymorphism (Abstract class and those marked with AdminPresentationClass.excludeFromPolymorphism()
). Override that exlusion behavior.useCache
- Cache the polymorphic types discovered for the ceilingClass.public Class<?>[] sortEntities(Class<?> ceilingClass, List<Class<?>> entities)
DynamicDaoHelper
sortEntities
in interface DynamicDaoHelper
public boolean isExcludeClassFromPolymorphism(Class<?> clazz)
DynamicDaoHelper
AdminPresentationClass.excludeFromPolymorphism()
.isExcludeClassFromPolymorphism
in interface DynamicDaoHelper
public Map<String,Object> getIdMetadata(Class<?> entityClass, javax.persistence.EntityManager entityManager)
DynamicDaoHelper
Type
instance for the property (e.g. LongType
).getIdMetadata
in interface DynamicDaoHelper
public List<String> getPropertyNames(Class<?> entityClass)
DynamicDaoHelper
getPropertyNames
in interface DynamicDaoHelper
public List<org.hibernate.type.Type> getPropertyTypes(Class<?> entityClass)
DynamicDaoHelper
Type
known to Hibernate for the entity class.getPropertyTypes
in interface DynamicDaoHelper
public Serializable getIdentifier(Object entity)
DynamicDaoHelper
getIdentifier
in interface DynamicDaoHelper
public Field getIdField(Class<?> clazz)
DynamicDaoHelper
getIdField
in interface DynamicDaoHelper
Copyright © 2022. All rights reserved.