|
||||||||||
| 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 JDOClassgetIdentityType in class JDOClassImplDynamicJDOIdentityType.APPLICATION,
JDOIdentityType.DATASTORE, or
JDOIdentityType.NONDURABLEpublic JavaType getObjectIdClass()
getObjectIdClass in interface JDOClassgetObjectIdClass in class JDOClassImplDynamicpublic JDOClass getPersistenceCapableSuperclass()
null is returned.
getPersistenceCapableSuperclass in interface JDOClassgetPersistenceCapableSuperclass in class JDOClassImplDynamicnull 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 JDOClassgetJavaType in class JDOClassImplDynamic
public void removeDeclaredMember(JDOMember member)
throws ModelException
removeDeclaredMember in interface JDOClassremoveDeclaredMember in class JDOClassImplDynamicmember - the member to be removed
ModelException - if impossible
public 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 JDOClasscreateJDOField in class JDOClassImplDynamicname - 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 JDOClassgetDeclaredManagedFields in class JDOClassImplDynamicpublic 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 JDOClassgetManagedFields in class JDOClassImplDynamicpublic 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 JDOClassgetPersistentFields in class JDOClassImplDynamicpublic JDOField[] getPrimaryKeyFields()
JDOField.isPrimaryKey()).
getPrimaryKeyFields in interface JDOClassgetPrimaryKeyFields in class JDOClassImplDynamicpublic JDOField[] getPersistentRelationshipFields()
JDOField.getRelationship() returns
a non null value) and having the persistence-modifier
PersistenceModifier.PERSISTENT.
getPersistentRelationshipFields in interface JDOClassgetPersistentRelationshipFields in class JDOClassImplDynamicpublic JDOField[] getDefaultFetchGroupFields()
JDOField.isDefaultFetchGroup() returns true.
getDefaultFetchGroupFields in interface JDOClassgetDefaultFetchGroupFields in class JDOClassImplDynamicpublic 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 JDOClassgetManagedFieldNumbers in class JDOClassImplDynamicpublic int[] getPersistentFieldNumbers()
PersistenceModifier.PERSISTENT.
getPersistentFieldNumbers in interface JDOClassgetPersistentFieldNumbers in class JDOClassImplDynamicpublic int[] getPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()).
getPrimaryKeyFieldNumbers in interface JDOClassgetPrimaryKeyFieldNumbers in class JDOClassImplDynamicpublic 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 JDOClassgetPersistentNonPrimaryKeyFieldNumbers in class JDOClassImplDynamicpublic int[] getPersistentRelationshipFieldNumbers()
JDOField.getRelationship() returns a non null value) and has the
persistence-modifier
PersistenceModifier.PERSISTENT.
getPersistentRelationshipFieldNumbers in interface JDOClassgetPersistentRelationshipFieldNumbers in class JDOClassImplDynamicpublic int[] getPersistentSerializableFieldNumbers()
JDOField.isSerializable() returns true) and has the
persistence-modifier
PersistenceModifier.PERSISTENT.
getPersistentSerializableFieldNumbers in interface JDOClassgetPersistentSerializableFieldNumbers in class JDOClassImplDynamicpublic int getInheritedManagedFieldCount()
getInheritedManagedFieldCount in interface JDOClassgetInheritedManagedFieldCount in class JDOClassImplDynamicprotected void calculateFieldNumbers()
protected JDOClass newJDOClassInstance()
newJDOClassInstance in class JDOClassImplDynamicprotected JDOField newJDOFieldInstance()
newJDOFieldInstance in class JDOClassImplDynamic
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||