|
||||||||||
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
public class JDOClassImplDynamic
An instance of this class represents the JDO metadata of a persistence capable class. This dynamic implementation only stores property values explicitly set by setter method. It does not store any calculated values such as list of managed or persistent fields, list of field numbers etc.
TBD:
Field Summary | |
---|---|
protected int |
identityType
Property identityType. |
protected JavaType |
javaType
Property javaType. |
protected static I18NHelper |
msg
I18N support |
protected JavaType |
objectIdClass
Property objectIdClass. |
protected JDOClass |
pcSuperclass
Relationship JDOClass<->JDOClass. |
Constructor Summary | |
---|---|
JDOClassImplDynamic()
|
Method Summary | |
---|---|
JDOClass |
createJDOClass(java.lang.String name)
This method returns a JDOClass instance representing an inner class of this JDOClass If this JDOClass already declares such an inner class, the existing JDOClass instance is returned. |
JDOField |
createJDOField(java.lang.String name)
This method returns a JDOField instance for the field with the specified name. |
JDOClass[] |
getDeclaredClasses()
Returns the collection of JDOClass instances declared by this JDOClass. |
JDOField |
getDeclaredField(java.lang.String fieldName)
Returns JDOField metadata for a particular declared field specified by field name. |
JDOField[] |
getDeclaredFields()
Returns the collection of JDOField instances declared by this JDOClass in the form of an array. |
int |
getDeclaredManagedFieldCount()
Returns the number of managed fields declared in the class represented by this JDOClass. |
JDOField[] |
getDeclaredManagedFields()
Returns the collection of managed JDOField instances declared by this JDOClass in the form of an array. |
JDOMember[] |
getDeclaredMembers()
Returns the collection of JDOMember instances declared by this JDOClass in form of an array. |
java.lang.String |
getDeclaredObjectIdClassName()
Get the fully qualified name of the object identity class (primary key class) for this JDOClass. |
JDOModel |
getDeclaringModel()
Returns the declaring JDOModel of this JDOClass. |
JDOField[] |
getDefaultFetchGroupFields()
Returns the collection of default fetch group fields of this JDOClass in the form of an array. |
JDOField |
getField(int fieldNumber)
Provides metadata for a particular field specified by the absolute field number. |
JDOField |
getField(java.lang.String fieldName)
Returns JDOField metadata for a particular field specified by field name. |
protected JDOField |
getFieldInternal(java.lang.String fieldName)
Returns the JDOField definition for the specified field. |
int |
getIdentityType()
Get the JDO identity type of this JDOClass. |
int |
getInheritedManagedFieldCount()
Returns the number of inherited managed fields for the class represented by this JDOClass. |
JavaType |
getJavaType()
Provides the JavaType representaion corresponding to this JDOClass. |
JDOPackage |
getJDOPackage()
Returns the JDOPackage instance corresponding to the package name of this JDOClass. |
JDOField |
getManagedField(java.lang.String fieldName)
Returns JDOField metadata for a particular managed field specified by field name. |
int |
getManagedFieldCount()
Returns the number of managed fields for the class represented by 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. |
java.lang.String |
getPackagePrefix()
Returns the package name including a terminating dot if this class has a package. |
JDOClass |
getPersistenceCapableRootClass()
Returns the least-derived (topmost) persistence-capable class in the hierarchy of this JDOClass. |
JDOClass |
getPersistenceCapableSuperclass()
Returns the JDOClass instance for the persistence-capable superclass of this JDOClass. |
java.lang.String |
getPersistenceCapableSuperclassName()
Get the fully qualified class name of the persistence-capable superclass of the persistence-capable class described by 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. |
boolean |
isXMLMetadataLoaded()
Determines whether the XML metadata for the class represented by this JDOClass has been loaded. |
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. |
boolean |
requiresExtent()
Determines whether an extent must be managed for the persistence-capable class described by this JDOClass. |
void |
setDeclaredObjectIdClassName(java.lang.String declaredObjectIdClassName)
Set the fully qualified name of the object identity class (primary key class) for this JDOClass. |
void |
setDeclaringModel(JDOModel model)
Set the declaring JDOModel for this JDOClass. |
void |
setIdentityType(int identityType)
Set the object identity type of this JDOClass. |
void |
setJavaType(JavaType javaType)
Set the JavaType representation corresponding to this JDOClass. |
void |
setJDOPackage(JDOPackage jdoPackage)
Sets the JDOPackage instance corresponding to the package name of this JDOClass. |
void |
setObjectIdClass(JavaType objectIdClass)
Set the JavaType representation of the object identity class (primary key class) for this JDOClass. |
void |
setPersistenceCapableSuperclass(JDOClass pcSuperclass)
Set the JDOClass for the persistence-capable superclass of this JDOClass. |
void |
setPersistenceCapableSuperclassName(java.lang.String pcSuperclassName)
Set the fully qualified class name of the persistence-capable superclass of the persistence-capable class described by this JDOClass. |
void |
setRequiresExtent(boolean requiresExtent)
Set whether an extent must be managed for the persistence-capable class described by this JDOClass. |
void |
setXMLMetadataLoaded()
Sets the flag indicating that the class XML metadata for this JDOClass is loaded to true . |
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 |
Field Detail |
---|
protected int identityType
getIdentityType()
.
protected transient JavaType objectIdClass
protected JDOClass pcSuperclass
protected transient JavaType javaType
protected static final I18NHelper msg
Constructor Detail |
---|
public JDOClassImplDynamic()
Method Detail |
---|
public int getIdentityType()
JDOIdentityType.APPLICATION
if objectid-class is
specified, and JDOIdentityType.DATASTORE
, if not.
getIdentityType
in interface JDOClass
JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
public void setIdentityType(int identityType)
setIdentityType
in interface JDOClass
identityType
- an integer indicating the JDO identity type, one of:
JDOIdentityType.APPLICATION
,
JDOIdentityType.DATASTORE
, or
JDOIdentityType.NONDURABLE
public JavaType getObjectIdClass()
getObjectIdClass
in interface JDOClass
public void setObjectIdClass(JavaType objectIdClass)
setObjectIdClass
in interface JDOClass
objectIdClass
- the JavaType representation of the
object identity classpublic java.lang.String getDeclaredObjectIdClassName()
getDeclaredObjectIdClassName
in interface JDOClass
public void setDeclaredObjectIdClassName(java.lang.String declaredObjectIdClassName)
setDeclaredObjectIdClassName
in interface JDOClass
declaredObjectIdClassName
- the name of the object identity classpublic boolean requiresExtent()
requiresExtent
in interface JDOClass
true
if this class must manage an extent;
false
otherwisepublic void setRequiresExtent(boolean requiresExtent)
setRequiresExtent
in interface JDOClass
requiresExtent
- true
if this class must manage
an extent; false
otherwisepublic java.lang.String getPersistenceCapableSuperclassName()
null
is returned.
getPersistenceCapableSuperclassName
in interface JDOClass
null
if there is no persistence-capable superclasspublic void setPersistenceCapableSuperclassName(java.lang.String pcSuperclassName)
setPersistenceCapableSuperclassName
in interface JDOClass
pcSuperclassName
- the fully qualified name of the
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
public void setJavaType(JavaType javaType)
setJavaType
in interface JDOClass
javaType
- the JavaType representation for this JDOClasspublic boolean isXMLMetadataLoaded()
isXMLMetadataLoaded
in interface JDOClass
true
if XML metadata is loaded;
false
otherwisepublic void setXMLMetadataLoaded()
true
.
setXMLMetadataLoaded
in interface JDOClass
public void removeDeclaredMember(JDOMember member) throws ModelException
removeDeclaredMember
in interface JDOClass
member
- the member to be removed
ModelException
- if impossiblepublic JDOMember[] getDeclaredMembers()
getDeclaredMembers
in interface JDOClass
public JDOModel getDeclaringModel()
getDeclaringModel
in interface JDOClass
public void setDeclaringModel(JDOModel model)
setDeclaringModel
in interface JDOClass
model
- the declaring JDOModel of this JDOClasspublic JDOClass getPersistenceCapableSuperclass()
null
is returned.
getPersistenceCapableSuperclass
in interface JDOClass
null
if there is no persistence-capable superclasspublic void setPersistenceCapableSuperclass(JDOClass pcSuperclass)
setPersistenceCapableSuperclass
in interface JDOClass
pcSuperclass
- the JDClass instance of the persistence-capable
superclasspublic JDOPackage getJDOPackage()
getJDOPackage
in interface JDOClass
public void setJDOPackage(JDOPackage jdoPackage)
setJDOPackage
in interface JDOClass
jdoPackage
- the JDOPackage of this JDOClass.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 JDOClass
name
- the name of the field
ModelException
- if impossiblepublic JDOClass createJDOClass(java.lang.String name) throws ModelException
createJDOClass
in interface JDOClass
name
- the name of the inner class
ModelException
- if impossiblepublic JDOClass[] getDeclaredClasses()
getDeclaredClasses
in interface JDOClass
public JDOField[] getDeclaredFields()
getDeclaredFields
in interface JDOClass
public 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
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
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
public JDOField[] getPrimaryKeyFields()
JDOField.isPrimaryKey()
).
getPrimaryKeyFields
in interface JDOClass
public JDOField[] getPersistentRelationshipFields()
JDOField.getRelationship()
returns
a non null value) and having the persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentRelationshipFields
in interface JDOClass
public JDOField[] getDefaultFetchGroupFields()
JDOField.isDefaultFetchGroup()
returns true
.
getDefaultFetchGroupFields
in interface JDOClass
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
public int[] getPersistentFieldNumbers()
PersistenceModifier.PERSISTENT
.
getPersistentFieldNumbers
in interface JDOClass
public int[] getPrimaryKeyFieldNumbers()
JDOField.isPrimaryKey()
).
getPrimaryKeyFieldNumbers
in interface JDOClass
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
public int[] getPersistentRelationshipFieldNumbers()
JDOField.getRelationship()
returns a non null value) and has the
persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentRelationshipFieldNumbers
in interface JDOClass
public int[] getPersistentSerializableFieldNumbers()
JDOField.isSerializable()
returns true
) and has the
persistence-modifier
PersistenceModifier.PERSISTENT
.
getPersistentSerializableFieldNumbers
in interface JDOClass
public JDOField getManagedField(java.lang.String fieldName)
null
if the specified name does not
denote a managed field of this JDOClass. The field name may be
unqualified and or qualified (see getField(String fieldName)
).
getManagedField
in interface JDOClass
fieldName
- the name of the managed field for which field metadata
is needed.
null
if there is no such field.public JDOField getField(java.lang.String fieldName)
null
if the specified name does not denote a
field of this JDOClass.
The method supports lookup by unqualified and by qualified field name.
null
if the
qualifier class does not denote a valid class or if the qualifier class
is not a persistence-capable superclass of this class.
getField
in interface JDOClass
fieldName
- the unqualified or qualified name of field for which
field metadata is needed.
null
if there is no such field.public JDOField getField(int fieldNumber)
0 <= fieldNumber < this.getManagedFields().length
If the field number is valid the returned JDoField instance denotes a
managed field, meaning the field has the persistence-modifier
PersistenceModifier.PERSISTENT
or
PersistenceModifier.TRANSACTIONAL
.
If the field number is not valid then the method returns
null
.
getField
in interface JDOClass
fieldNumber
- the number for which field metadata is needed.
null
if there is no such field.public JDOField getDeclaredField(java.lang.String fieldName)
null
if the field name does not denote a field declared by
JDOClass.
getDeclaredField
in interface JDOClass
fieldName
- the unqualified name of field for which field metadata
is needed.
null
if there is no such field declared by this JDOClass.public int getDeclaredManagedFieldCount()
getDeclaredManagedFieldCount
in interface JDOClass
public int getInheritedManagedFieldCount()
getInheritedManagedFieldCount
in interface JDOClass
public int getManagedFieldCount()
getDeclaredManagedFieldCount() +
getInheritedManagedFieldCount()
.
getManagedFieldCount
in interface JDOClass
public java.lang.String getPackagePrefix()
getPackagePrefix
in interface JDOClass
public JDOClass getPersistenceCapableRootClass()
getPersistenceCapableRootClass
in interface JDOClass
protected JDOField getFieldInternal(java.lang.String fieldName)
fieldName
- the unqualified field name
null
otherwise.protected JDOClass newJDOClassInstance()
protected JDOField newJDOFieldInstance()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |