|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.jdo.JDOElementImpl
org.apache.jdo.impl.model.jdo.JDOMemberImpl
org.apache.jdo.impl.model.jdo.JDOClassImplDynamic
org.apache.jdo.impl.model.jdo.caching.JDOClassImplCaching
An instance of this class represents the JDO metadata of a persistence capable class. This caching implementation caches any calulated value to avoid re-calculating it if it is requested again.
Field Summary | |
private JDOField[] |
declaredManagedFields
Array of declared managed fields, sorted by name (see JDO spec). |
private JDOField[] |
defaultFetchGroupFields
Default fetch group fields. |
private boolean |
fieldNumbersCalculated
Flag indicating wthere field numbers are calculated already. |
private int |
inheritedManagedFieldCount
Number of inherited fields. |
private int[] |
managedFieldNumbers
Field numbers of managed fields. |
private JDOField[] |
managedFields
Array of managed fields, incluing inherited fields. |
private int[] |
nonPrimaryKeyFieldNumbers
Field numbers of managed non primaryKey fields. |
private boolean |
objectIdClassResolved
Flag indicating whether the objectIdClass is resolved already. |
private boolean |
pcSuperclassResolved
Flag indicating whether the pcSuperclass is resolved already. |
private int[] |
persistentFieldNumbers
Field numbers of PERSISTENT fields. |
private JDOField[] |
persistentFields
Array of persistent fields, incluing inherited fields. |
private int[] |
persistentNonPrimaryKeyFieldNumbers
Field numbers of persistent non primaryKey fields. |
private int[] |
persistentRelationshipFieldNumbers
Field numbers of persistent relationship fields. |
private JDOField[] |
persistentRelationshipFields
Persistent relationship fields. |
private int[] |
persistentSerializableFieldNumbers
Field numbers of persistent, serializable fields. |
private int[] |
primaryKeyFieldNumbers
Field numbers of primaryKey fields. |
private JDOField[] |
primaryKeyFields
Primary key fields. |
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOClassImplDynamic |
identityType, javaType, msg, objectIdClass, pcSuperclass, shortName |
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOMemberImpl |
|
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
|
Constructor Summary | |
protected |
JDOClassImplCaching(java.lang.String name)
Constructor. |
protected |
JDOClassImplCaching(java.lang.String name,
JDOClass declaringClass)
Constructor for inner classes. |
Method Summary | |
protected void |
calculateFieldNumbers()
This method calculates the relative field number of the declared managed fields of this JDOClass and uddates the relativeFieldNumber property of the JDOField instance. |
JDOField |
createJDOField(java.lang.String name)
This method returns a JDOField instance for the field with the specified name. |
JDOField[] |
getDeclaredManagedFields()
Returns the collection of managed JDOField instances declared by this JDOClass in the form of an array. |
JDOField[] |
getDefaultFetchGroupFields()
Returns the collection of default fetch group fields of this JDOClass in the form of an array. |
int |
getIdentityType()
Get the JDO identity type of this JDOClass. |
int |
getInheritedManagedFieldCount()
Returns the number of inherited managed fields for this class. |
JavaType |
getJavaType()
Provides the JavaType representaion corresponding to this JDOClass. |
int[] |
getManagedFieldNumbers()
Returns an array of absolute field numbers of the managed fields of this JDOClass. |
JDOField[] |
getManagedFields()
Returns the collection of managed JDOField instances of this JDOClass in the form of an array. |
JavaType |
getObjectIdClass()
Get the JavaType representation of the object identity class (primary key class) for this JDOClass. |
JDOClass |
getPersistenceCapableSuperclass()
Returns the JDOClass instance for the persistence-capable superclass of this JDOClass. |
int[] |
getPersistentFieldNumbers()
Returns an array of absolute field numbers of the persistent fields of this JDOClass. |
JDOField[] |
getPersistentFields()
Returns the collection of persistent JDOField instances of this JDOClass in the form of an array. |
int[] |
getPersistentNonPrimaryKeyFieldNumbers()
Returns an array of absolute field numbers of the non identifying, persistent fields of this JDOClass. |
int[] |
getPersistentRelationshipFieldNumbers()
Returns an array of absolute field numbers of persistent relationship fields of this JDOClass. |
JDOField[] |
getPersistentRelationshipFields()
Returns the collection of persistent relationship fields of this JDOClass in the form of an array. |
int[] |
getPersistentSerializableFieldNumbers()
Returns an array of absolute field numbers of persistent, serializable fields of this JDOClass. |
int[] |
getPrimaryKeyFieldNumbers()
Returns an array of absolute field numbers of the identifying fields of this JDOClass. |
JDOField[] |
getPrimaryKeyFields()
Returns the collection of identifying fields of this JDOClass in the form of an array. |
java.lang.String |
getShortName()
Get the short name of this JDOClass. |
protected JDOClass |
newJDOClassInstance(java.lang.String name)
Returns a new instance of the JDOClass implementation class. |
protected JDOField |
newJDOFieldInstance(java.lang.String name)
Returns a new instance of the JDOField implementation class. |
protected JDOProperty |
newJDOPropertyInstance(java.lang.String name)
Returns a new instance of the JDOProperty implementation class. |
protected JDOProperty |
newJDOPropertyInstance(java.lang.String name,
JDOField associatedJDOField)
Returns a new instance of the JDOProperty implementation class. |
void |
removeDeclaredMember(JDOMember member)
Remove the supplied member from the collection of members maintained by this JDOClass. |
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOMemberImpl |
compareTo, equals, getDeclaringClass, getName, hashCode, toString |
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOElementImpl |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, firePropertyChange, fireVetoableChange, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jdo.model.jdo.JDOMember |
getDeclaringClass, getName |
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement |
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
private boolean objectIdClassResolved
private boolean pcSuperclassResolved
private JDOField[] declaredManagedFields
private JDOField[] managedFields
private JDOField[] persistentFields
private JDOField[] primaryKeyFields
private JDOField[] persistentRelationshipFields
private JDOField[] defaultFetchGroupFields
private int inheritedManagedFieldCount
private int[] managedFieldNumbers
private int[] persistentFieldNumbers
private int[] primaryKeyFieldNumbers
private int[] nonPrimaryKeyFieldNumbers
private int[] persistentNonPrimaryKeyFieldNumbers
private int[] persistentRelationshipFieldNumbers
private int[] persistentSerializableFieldNumbers
private boolean fieldNumbersCalculated
Constructor Detail |
protected JDOClassImplCaching(java.lang.String name)
protected JDOClassImplCaching(java.lang.String name, JDOClass declaringClass)
Method Detail |
public java.lang.String getShortName()
JDOClassImplDynamic.setShortName(String shortName)
.
getShortName
in interface JDOClass
getShortName
in class JDOClassImplDynamic
public int getIdentityType()
JDOIdentityType.APPLICATION
if objectid-class is
specified, and JDOIdentityType.DATASTORE
, if not.
getIdentityType
in interface JDOClass
getIdentityType
in class JDOClassImplDynamic
JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
public JavaType getObjectIdClass()
getObjectIdClass
in interface JDOClass
getObjectIdClass
in class JDOClassImplDynamic
public JDOClass getPersistenceCapableSuperclass()
null
is returned.
getPersistenceCapableSuperclass
in interface JDOClass
getPersistenceCapableSuperclass
in class JDOClassImplDynamic
null
if there is no persistence-capable superclasspublic JavaType getJavaType()
Note the difference between Object.getClass() and this method. The former returns the class of the object in hand, this returns the class of the object represented by this meta data.
getJavaType
in interface JDOClass
getJavaType
in class JDOClassImplDynamic
public void removeDeclaredMember(JDOMember member) throws ModelException
removeDeclaredMember
in interface JDOClass
removeDeclaredMember
in class JDOClassImplDynamic
member
- the member to be removed
ModelException
- if impossiblepublic JDOField createJDOField(java.lang.String name) throws ModelException
Note, if the field numbers for the managed fields of this JDOClass are calculated, this methid will fail to create a new JDOField. Any new field would possibly invalidate existing field number
createJDOField
in interface JDOClass
createJDOField
in class JDOClassImplDynamic
name
- the name of the field
ModelException
- if impossiblepublic JDOField[] getDeclaredManagedFields()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
.
The position of the fields in the returned array equals their
relative field number as returned by
JDOField.getRelativeFieldNumber()
. The following holds
true for any field in the returned array:
getDeclaredManagedFields()[i].getRelativeFieldNumber()
== i
getDeclaredManagedFields()[field.getRelativeFieldNumber()]
== field
getDeclaredManagedFields
in interface JDOClass
getDeclaredManagedFields
in class JDOClassImplDynamic
public JDOField[] getManagedFields()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
.
The position of the fields in the returned array equals their
absolute field number as returned by
JDOField.getFieldNumber()
. The following holds true for
any field in the returned array:
getManagedFields()[i].getFieldNumber() == i
getManagedFields()[field.getFieldNumber()] == field
getManagedFields
in interface JDOClass
getManagedFields
in class JDOClassImplDynamic
public JDOField[] getPersistentFields()
PersistenceModifier.PERSISTENT
.
Please note, the position of the fields in the returned array might not
equal their absolute field number as returned by
JDOField.getFieldNumber()
.
getPersistentFields
in interface JDOClass
getPersistentFields
in class JDOClassImplDynamic
public JDOField[] getPrimaryKeyFields()
JDOField.isPrimaryKey()
).
getPrimaryKeyFields
in interface JDOClass
getPrimaryKeyFields
in class JDOClassImplDynamic
public JDOField[] getPersistentRelationshipFields()
JDOField.getRelationship()
returns
a non null value) and having the persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentRelationshipFields
in interface JDOClass
getPersistentRelationshipFields
in class JDOClassImplDynamic
public JDOField[] getDefaultFetchGroupFields()
JDOField.isDefaultFetchGroup()
returns true
.
getDefaultFetchGroupFields
in interface JDOClass
getDefaultFetchGroupFields
in class JDOClassImplDynamic
public int[] getManagedFieldNumbers()
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
.
Only managed fields have a valid field number, thus the field number in
the returned array equals its index:
getManagedFields()[i] == i
getManagedFieldNumbers
in interface JDOClass
getManagedFieldNumbers
in class JDOClassImplDynamic
public int[] getPersistentFieldNumbers()
PersistenceModifier.PERSISTENT
.
getPersistentFieldNumbers
in interface JDOClass
getPersistentFieldNumbers
in class JDOClassImplDynamic
public int[] getPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
getPrimaryKeyFieldNumbers
in interface JDOClass
getPrimaryKeyFieldNumbers
in class JDOClassImplDynamic
public int[] getPersistentNonPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
A field is a persistent field, if it has the persistence-modifier
PersistenceModifier.PERSISTENT
or
(see JDOField.getPersistenceModifier()
).
getPersistentNonPrimaryKeyFieldNumbers
in interface JDOClass
getPersistentNonPrimaryKeyFieldNumbers
in class JDOClassImplDynamic
public int[] getPersistentRelationshipFieldNumbers()
JDOField.getRelationship()
returns a non null value) and has the
persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentRelationshipFieldNumbers
in interface JDOClass
getPersistentRelationshipFieldNumbers
in class JDOClassImplDynamic
public int[] getPersistentSerializableFieldNumbers()
JDOField.isSerializable()
returns true
) and has the
persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentSerializableFieldNumbers
in interface JDOClass
getPersistentSerializableFieldNumbers
in class JDOClassImplDynamic
public int getInheritedManagedFieldCount()
getInheritedManagedFieldCount
in interface JDOClass
getInheritedManagedFieldCount
in class JDOClassImplDynamic
protected void calculateFieldNumbers()
protected JDOClass newJDOClassInstance(java.lang.String name)
newJDOClassInstance
in class JDOClassImplDynamic
protected JDOField newJDOFieldInstance(java.lang.String name)
newJDOFieldInstance
in class JDOClassImplDynamic
protected JDOProperty newJDOPropertyInstance(java.lang.String name)
newJDOPropertyInstance
in class JDOClassImplDynamic
protected JDOProperty newJDOPropertyInstance(java.lang.String name, JDOField associatedJDOField) throws ModelException
newJDOPropertyInstance
in class JDOClassImplDynamic
ModelException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |