|
||||||||||
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
public class 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 |
---|
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOClassImplDynamic |
---|
identityType, javaType, msg, objectIdClass, pcSuperclass |
Constructor Summary | |
---|---|
JDOClassImplCaching()
|
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. |
protected JDOClass |
newJDOClassInstance()
Returns a new instance of the JDOClass implementation class. |
protected JDOField |
newJDOFieldInstance()
Returns a new instance of the JDOField 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, setDeclaringClass, setName, 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, setDeclaringClass, setName |
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 |
Constructor Detail |
---|
public JDOClassImplCaching()
Method Detail |
---|
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()
newJDOClassInstance
in class JDOClassImplDynamic
protected JDOField newJDOFieldInstance()
newJDOFieldInstance
in class JDOClassImplDynamic
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |