Module org.eclipse.persistence.jpa
Class ClassDetails
java.lang.Object
org.eclipse.persistence.internal.jpa.weaving.ClassDetails
Internal helper class that holds details of a persistent class.
Used by
PersistenceWeaver
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
<String, AttributeDetails> Map of this class' persistent attributes where the key is the Attribute name.protected String
Name of this class.protected MetadataClass
protected Map
<String, AttributeDetails> Map of this class' persistent get methods where the key is the getMethod name.protected boolean
Determine if this class specifically implements a clone methodprotected boolean
Determine if a JPA "embedable" (aggregate).protected boolean
Determine if a JPA "mapped superclass".protected Map
<String, AttributeDetails> Map of this class' persistent set methods where the key is the setMethod name.protected boolean
Define if change tracking should be weaved in this class.protected boolean
Determine if a new constructor can be used to bypass setting variables to default values.protected boolean
Define if fetch groups should be weaved in this class.protected boolean
Define if internal optimizations should be weaved in this class.protected boolean
Define if this class should be weaved for our REST supportprotected boolean
Define if lazy value holders should be weaved in this class.protected ClassDetails
Superclass' ClassDetails - only populated if superclass is also persistent.protected String
Superclass' name.protected boolean
Determine if class uses attribute access, lazily initialized.protected List
<VirtualAttributeMethodInfo> The methods that are used by virtual attributes as getter methods. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Returns true if Used with field access, and is set to false if transient variables are discoveredboolean
getAttributeDetailsFromClassOrSuperClass
(String attributeName) boolean
getInfoForVirtualGetMethod
(String getMethodName) INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given getMethodName.getInfoForVirtualSetMethod
(String setMethodName) INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given setMethodName.Return the name of the most direct superclass that has a direct implementation of a clone method.boolean
boolean
isInMetadataHierarchy
(String className) Returns true if the given class name represents this class, or any superclass that can be navigated to by recursively navigating up the structure of superClassDetails stored in this class.boolean
isInSuperclassHierarchy
(String className) Returns true if the given class name represents this class, or any superclass that can be navigated to by recursively navigating up the structure of superClassDetails stored in this class.boolean
void
setAttributesMap
(Map<String, AttributeDetails> attributesMap) void
setClassName
(String className) void
setDescribedClass
(MetadataClass describedClass) void
void
setImplementsCloneMethod
(boolean implementsCloneMethod) void
setIsEmbedable
(boolean isEmbedable) void
setIsMappedSuperClass
(boolean isMappedSuperClass) void
void
setShouldWeaveChangeTracking
(boolean shouldWeaveChangeTracking) void
setShouldWeaveConstructorOptimization
(boolean shouldWeaveConstructorOptimization) void
setShouldWeaveFetchGroups
(boolean shouldWeaveFetchGroups) void
setShouldWeaveInternal
(boolean shouldWeaveInternal) void
setShouldWeaveREST
(boolean shouldWeaveRest) void
setShouldWeaveValueHolders
(boolean shouldWeaveValueHolders) void
setSuperClassDetails
(ClassDetails superClassDetails) void
setSuperClassName
(String superClassName) void
setVirtualAccessMethods
(List<VirtualAttributeMethodInfo> virtualAccessMethods) boolean
boolean
boolean
boolean
boolean
void
boolean
If one attribute of this class uses attribute access, by the JPA specification, all attributes must use attribute access This method assumes it is called when this class details is completely initialized.
-
Field Details
-
describedClass
-
className
Name of this class. -
superClassName
Superclass' name. -
superClassDetails
Superclass' ClassDetails - only populated if superclass is also persistent. -
shouldWeaveValueHolders
protected boolean shouldWeaveValueHoldersDefine if lazy value holders should be weaved in this class. -
shouldWeaveChangeTracking
protected boolean shouldWeaveChangeTrackingDefine if change tracking should be weaved in this class. -
shouldWeaveFetchGroups
protected boolean shouldWeaveFetchGroupsDefine if fetch groups should be weaved in this class. -
shouldWeaveInternal
protected boolean shouldWeaveInternalDefine if internal optimizations should be weaved in this class. -
shouldWeaveRest
protected boolean shouldWeaveRestDefine if this class should be weaved for our REST support -
attributesMap
Map of this class' persistent attributes where the key is the Attribute name. -
getterMethodToAttributeDetails
Map of this class' persistent get methods where the key is the getMethod name. -
setterMethodToAttributeDetails
Map of this class' persistent set methods where the key is the setMethod name. -
isMappedSuperClass
protected boolean isMappedSuperClassDetermine if a JPA "mapped superclass". -
isEmbedable
protected boolean isEmbedableDetermine if a JPA "embedable" (aggregate). -
usesAttributeAccess
protected boolean usesAttributeAccessDetermine if class uses attribute access, lazily initialized. -
implementsCloneMethod
protected boolean implementsCloneMethodDetermine if this class specifically implements a clone method -
shouldWeaveConstructorOptimization
protected boolean shouldWeaveConstructorOptimizationDetermine if a new constructor can be used to bypass setting variables to default values. -
virtualAccessMethods
The methods that are used by virtual attributes as getter methods. These will be used by our weaver to properly weave those methods This list should be kept in sync with virtualSetMethodNames. Every time a value is added, one should be added to virtualSetMethodNames so that at a particular index, the virtualGetMethodName and the virtualSetMethodCoorespond
-
-
Constructor Details
-
ClassDetails
public ClassDetails()
-
-
Method Details
-
getDescribedClass
-
getClassName
-
setDescribedClass
-
setClassName
-
getSuperClassName
-
setSuperClassName
-
getSuperClassDetails
-
setSuperClassDetails
-
shouldWeaveValueHolders
public boolean shouldWeaveValueHolders() -
setShouldWeaveValueHolders
public void setShouldWeaveValueHolders(boolean shouldWeaveValueHolders) -
shouldWeaveChangeTracking
public boolean shouldWeaveChangeTracking() -
setShouldWeaveChangeTracking
public void setShouldWeaveChangeTracking(boolean shouldWeaveChangeTracking) -
setShouldWeaveConstructorOptimization
public void setShouldWeaveConstructorOptimization(boolean shouldWeaveConstructorOptimization) -
shouldWeaveFetchGroups
public boolean shouldWeaveFetchGroups() -
setShouldWeaveFetchGroups
public void setShouldWeaveFetchGroups(boolean shouldWeaveFetchGroups) -
shouldWeaveInternal
public boolean shouldWeaveInternal() -
setShouldWeaveInternal
public void setShouldWeaveInternal(boolean shouldWeaveInternal) -
shouldWeaveREST
public boolean shouldWeaveREST() -
setShouldWeaveREST
public void setShouldWeaveREST(boolean shouldWeaveRest) -
getAttributesMap
-
getGetterMethodToAttributeDetails
-
getSetterMethodToAttributeDetails
-
setAttributesMap
-
setGetterMethodToAttributeDetails
-
getImplementsCloneMethod
public boolean getImplementsCloneMethod() -
getInfoForVirtualGetMethod
INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given getMethodName. Return the VirtualAttributeMethodInfo if there is one, else return null -
getInfoForVirtualSetMethod
INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given setMethodName. Return the VirtualAttributeMethodInfo if there is one, else return null -
setImplementsCloneMethod
public void setImplementsCloneMethod(boolean implementsCloneMethod) -
getNameOfSuperclassImplementingCloneMethod
Return the name of the most direct superclass that has a direct implementation of a clone method. If there is not one, return null -
getVirtualAccessMethods
-
setVirtualAccessMethods
-
isMappedSuperClass
public boolean isMappedSuperClass() -
setIsMappedSuperClass
public void setIsMappedSuperClass(boolean isMappedSuperClass) -
isEmbedable
public boolean isEmbedable() -
setIsEmbedable
public void setIsEmbedable(boolean isEmbedable) -
setSetterMethodToAttributeDetails
-
usesAttributeAccess
public boolean usesAttributeAccess()If one attribute of this class uses attribute access, by the JPA specification, all attributes must use attribute access This method assumes it is called when this class details is completely initialized. -
useAttributeAccess
public void useAttributeAccess() -
getAttributeDetailsFromClassOrSuperClass
-
doesSuperclassWeaveChangeTracking
public boolean doesSuperclassWeaveChangeTracking() -
canWeaveChangeTracking
public boolean canWeaveChangeTracking() -
canWeaveConstructorOptimization
public boolean canWeaveConstructorOptimization()Returns true if Used with field access, and is set to false if transient variables are discovered -
isInMetadataHierarchy
Returns true if the given class name represents this class, or any superclass that can be navigated to by recursively navigating up the structure of superClassDetails stored in this class. Assume java.lang.Object is in the hierarchy -
isInSuperclassHierarchy
Returns true if the given class name represents this class, or any superclass that can be navigated to by recursively navigating up the structure of superClassDetails stored in this class. Assume java.lang.Object is in the hierarchy
-