Class ClassDetails
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.weaving.ClassDetails
-
public class ClassDetails extends java.lang.ObjectInternal helper class that holds details of a persistent class. Used byPersistenceWeaver
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,AttributeDetails>attributesMapMap of this class' persistent attributes where the key is the Attribute name.protected java.lang.StringclassNameName of this class.protected MetadataClassdescribedClassprotected java.util.Map<java.lang.String,AttributeDetails>getterMethodToAttributeDetailsMap of this class' persistent get methods where the key is the getMethod name.protected booleanimplementsCloneMethodDetermine if this class specifically implements a clone methodprotected booleanisEmbedableDetermine if a JPA "embedable" (aggregate).protected booleanisMappedSuperClassDetermine if a JPA "mapped superclass".protected java.util.Map<java.lang.String,AttributeDetails>setterMethodToAttributeDetailsMap of this class' persistent set methods where the key is the setMethod name.protected booleanshouldWeaveChangeTrackingDefine if change tracking should be weaved in this class.protected booleanshouldWeaveConstructorOptimizationDetermine if a new constructor can be used to bypass setting variables to default values.protected booleanshouldWeaveFetchGroupsDefine if fetch groups should be weaved in this class.protected booleanshouldWeaveInternalDefine if internal optimizations should be weaved in this class.protected booleanshouldWeaveRestDefine if this class should be weaved for our REST supportprotected booleanshouldWeaveValueHoldersDefine if lazy value holders should be weaved in this class.protected ClassDetailssuperClassDetailsSuperclass' ClassDetails - only populated if superclass is also persistent.protected java.lang.StringsuperClassNameSuperclass' name.protected booleanusesAttributeAccessDetermine if class uses attribute access, lazily initialized.protected java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo>virtualAccessMethodsThe methods that are used by virtual attributes as getter methods.
-
Constructor Summary
Constructors Constructor Description ClassDetails()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanWeaveChangeTracking()booleancanWeaveConstructorOptimization()Returns true if Used with field access, and is set to false if transient variables are discoveredbooleandoesSuperclassWeaveChangeTracking()AttributeDetailsgetAttributeDetailsFromClassOrSuperClass(java.lang.String attributeName)java.util.Map<java.lang.String,AttributeDetails>getAttributesMap()java.lang.StringgetClassName()MetadataClassgetDescribedClass()java.util.Map<java.lang.String,AttributeDetails>getGetterMethodToAttributeDetails()booleangetImplementsCloneMethod()org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfogetInfoForVirtualGetMethod(java.lang.String getMethodName)INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given getMethodName.org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfogetInfoForVirtualSetMethod(java.lang.String setMethodName)INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given setMethodName.java.lang.StringgetNameOfSuperclassImplementingCloneMethod()Return the name of the most direct superclass that has a direct implementation of a clone method.java.util.Map<java.lang.String,AttributeDetails>getSetterMethodToAttributeDetails()ClassDetailsgetSuperClassDetails()java.lang.StringgetSuperClassName()java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo>getVirtualAccessMethods()booleanisEmbedable()booleanisInMetadataHierarchy(java.lang.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.booleanisInSuperclassHierarchy(java.lang.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.booleanisMappedSuperClass()voidsetAttributesMap(java.util.Map<java.lang.String,AttributeDetails> attributesMap)voidsetClassName(java.lang.String className)voidsetDescribedClass(MetadataClass describedClass)voidsetGetterMethodToAttributeDetails(java.util.Map<java.lang.String,AttributeDetails> map)voidsetImplementsCloneMethod(boolean implementsCloneMethod)voidsetIsEmbedable(boolean isEmbedable)voidsetIsMappedSuperClass(boolean isMappedSuperClass)voidsetSetterMethodToAttributeDetails(java.util.Map map)voidsetShouldWeaveChangeTracking(boolean shouldWeaveChangeTracking)voidsetShouldWeaveConstructorOptimization(boolean shouldWeaveConstructorOptimization)voidsetShouldWeaveFetchGroups(boolean shouldWeaveFetchGroups)voidsetShouldWeaveInternal(boolean shouldWeaveInternal)voidsetShouldWeaveREST(boolean shouldWeaveRest)voidsetShouldWeaveValueHolders(boolean shouldWeaveValueHolders)voidsetSuperClassDetails(ClassDetails superClassDetails)voidsetSuperClassName(java.lang.String superClassName)voidsetVirtualAccessMethods(java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo> virtualAccessMethods)booleanshouldWeaveChangeTracking()booleanshouldWeaveFetchGroups()booleanshouldWeaveInternal()booleanshouldWeaveREST()booleanshouldWeaveValueHolders()voiduseAttributeAccess()booleanusesAttributeAccess()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 Detail
-
describedClass
protected MetadataClass describedClass
-
className
protected java.lang.String className
Name of this class.
-
superClassName
protected java.lang.String superClassName
Superclass' name.
-
superClassDetails
protected ClassDetails superClassDetails
Superclass' ClassDetails - only populated if superclass is also persistent.
-
shouldWeaveValueHolders
protected boolean shouldWeaveValueHolders
Define if lazy value holders should be weaved in this class.
-
shouldWeaveChangeTracking
protected boolean shouldWeaveChangeTracking
Define if change tracking should be weaved in this class.
-
shouldWeaveFetchGroups
protected boolean shouldWeaveFetchGroups
Define if fetch groups should be weaved in this class.
-
shouldWeaveInternal
protected boolean shouldWeaveInternal
Define if internal optimizations should be weaved in this class.
-
shouldWeaveRest
protected boolean shouldWeaveRest
Define if this class should be weaved for our REST support
-
attributesMap
protected java.util.Map<java.lang.String,AttributeDetails> attributesMap
Map of this class' persistent attributes where the key is the Attribute name.
-
getterMethodToAttributeDetails
protected java.util.Map<java.lang.String,AttributeDetails> getterMethodToAttributeDetails
Map of this class' persistent get methods where the key is the getMethod name.
-
setterMethodToAttributeDetails
protected java.util.Map<java.lang.String,AttributeDetails> setterMethodToAttributeDetails
Map of this class' persistent set methods where the key is the setMethod name.
-
isMappedSuperClass
protected boolean isMappedSuperClass
Determine if a JPA "mapped superclass".
-
isEmbedable
protected boolean isEmbedable
Determine if a JPA "embedable" (aggregate).
-
usesAttributeAccess
protected boolean usesAttributeAccess
Determine if class uses attribute access, lazily initialized.
-
implementsCloneMethod
protected boolean implementsCloneMethod
Determine if this class specifically implements a clone method
-
shouldWeaveConstructorOptimization
protected boolean shouldWeaveConstructorOptimization
Determine if a new constructor can be used to bypass setting variables to default values.
-
virtualAccessMethods
protected java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo> 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
-
-
Method Detail
-
getDescribedClass
public MetadataClass getDescribedClass()
-
getClassName
public java.lang.String getClassName()
-
setDescribedClass
public void setDescribedClass(MetadataClass describedClass)
-
setClassName
public void setClassName(java.lang.String className)
-
getSuperClassName
public java.lang.String getSuperClassName()
-
setSuperClassName
public void setSuperClassName(java.lang.String superClassName)
-
getSuperClassDetails
public ClassDetails getSuperClassDetails()
-
setSuperClassDetails
public void setSuperClassDetails(ClassDetails superClassDetails)
-
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
public java.util.Map<java.lang.String,AttributeDetails> getAttributesMap()
-
getGetterMethodToAttributeDetails
public java.util.Map<java.lang.String,AttributeDetails> getGetterMethodToAttributeDetails()
-
getSetterMethodToAttributeDetails
public java.util.Map<java.lang.String,AttributeDetails> getSetterMethodToAttributeDetails()
-
setAttributesMap
public void setAttributesMap(java.util.Map<java.lang.String,AttributeDetails> attributesMap)
-
setGetterMethodToAttributeDetails
public void setGetterMethodToAttributeDetails(java.util.Map<java.lang.String,AttributeDetails> map)
-
getImplementsCloneMethod
public boolean getImplementsCloneMethod()
-
getInfoForVirtualGetMethod
public org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo getInfoForVirtualGetMethod(java.lang.String getMethodName)
INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given getMethodName. Return the VirtualAttributeMethodInfo if there is one, else return null- Parameters:
getMethodName-- Returns:
-
getInfoForVirtualSetMethod
public org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo getInfoForVirtualSetMethod(java.lang.String setMethodName)
INTERNAL: Search the list of virtualAccessMethods for a VirtualAttributeMethodInfo with the given setMethodName. Return the VirtualAttributeMethodInfo if there is one, else return null- Parameters:
setMethodName-- Returns:
-
setImplementsCloneMethod
public void setImplementsCloneMethod(boolean implementsCloneMethod)
-
getNameOfSuperclassImplementingCloneMethod
public java.lang.String 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- Returns:
-
getVirtualAccessMethods
public java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo> getVirtualAccessMethods()
-
setVirtualAccessMethods
public void setVirtualAccessMethods(java.util.List<org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo> virtualAccessMethods)
-
isMappedSuperClass
public boolean isMappedSuperClass()
-
setIsMappedSuperClass
public void setIsMappedSuperClass(boolean isMappedSuperClass)
-
isEmbedable
public boolean isEmbedable()
-
setIsEmbedable
public void setIsEmbedable(boolean isEmbedable)
-
setSetterMethodToAttributeDetails
public void setSetterMethodToAttributeDetails(java.util.Map map)
-
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
public AttributeDetails getAttributeDetailsFromClassOrSuperClass(java.lang.String attributeName)
-
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
public boolean isInMetadataHierarchy(java.lang.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. Assume java.lang.Object is in the hierarchy- Parameters:
className-- Returns:
-
isInSuperclassHierarchy
public boolean isInSuperclassHierarchy(java.lang.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. Assume java.lang.Object is in the hierarchy- Parameters:
className-- Returns:
-
-