org.apache.jdo.impl.model.jdo.caching
Class JDOFieldImplCaching

java.lang.Object
  extended byorg.apache.jdo.impl.model.jdo.JDOElementImpl
      extended byorg.apache.jdo.impl.model.jdo.JDOMemberImpl
          extended byorg.apache.jdo.impl.model.jdo.JDOFieldImplDynamic
              extended byorg.apache.jdo.impl.model.jdo.caching.JDOFieldImplCaching
All Implemented Interfaces:
java.lang.Comparable, JDOElement, JDOField, JDOMember

public class JDOFieldImplCaching
extends JDOFieldImplDynamic

An instance of this class represents the JDO metadata of a managed field of a persistence capable class. This caching implementation caches any calulated value to avoid re-calculating it if it is requested again.

Please note, this implementation does not support changing the relationship property once it is defined (either explicitly by the setter or internally calculated by the getter). The second attempt to define the relationship will result in an exception.

Since:
1.1
Version:
1.1
Author:
Michael Bouschen

Field Summary
 
Fields inherited from class org.apache.jdo.impl.model.jdo.JDOFieldImplDynamic
defaultFetchGroup, embedded, msg, persistenceModifier, relationship
 
Constructor Summary
JDOFieldImplCaching()
           
 
Method Summary
 JDOArray createJDOArray()
          Creates and returns a new JDOArray instance.
protected  JDOArray createJDOArrayInternal()
          Creates and returns a new JDOArray instance.
 JDOCollection createJDOCollection()
          Creates and returns a new JDOCollection instance.
protected  JDOCollection createJDOCollectionInternal()
          Creates and returns a new JDOCollection instance.
 JDOMap createJDOMap()
          Creates and returns a new JDOMap instance.
protected  JDOMap createJDOMapInternal()
          Creates and returns a new JDOMap instance.
 JDOReference createJDOReference()
          Creates and returns a new JDOReference instance.
 int getPersistenceModifier()
          Get the persistence modifier of this JDOField.
 JDORelationship getRelationship()
          Get the relationship information for this JDOField.
 int getRelativeFieldNumber()
          Returns the relative field number of this JDOField.
 boolean isDefaultFetchGroup()
          Determines whether this JDOField is part of the default fetch group or not.
 boolean isEmbedded()
          Determines whether the field should be stored if possible as part of the instance instead of as its own instance in the datastore.
 
Methods inherited from class org.apache.jdo.impl.model.jdo.JDOFieldImplDynamic
createJDOReferenceInternal, getFieldNumber, getJavaField, getNullValueTreatment, getType, isManaged, isPersistent, isPrimaryKey, isRelationship, isSerializable, isTransactional, setDefaultFetchGroup, setEmbedded, setJavaField, setNullValueTreatment, setPersistenceModifier, setPrimaryKey, setRelationship, setSerializable
 
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

JDOFieldImplCaching

public JDOFieldImplCaching()
Method Detail

getPersistenceModifier

public int getPersistenceModifier()
Get the persistence modifier of this JDOField.

Specified by:
getPersistenceModifier in interface JDOField
Overrides:
getPersistenceModifier in class JDOFieldImplDynamic
Returns:
the persistence modifier, one of PersistenceModifier.NONE, PersistenceModifier.PERSISTENT, PersistenceModifier.TRANSACTIONAL, or PersistenceModifier.POSSIBLY_PERSISTENT.

getRelativeFieldNumber

public int getRelativeFieldNumber()
Returns the relative field number of this JDOField.

Specified by:
getRelativeFieldNumber in interface JDOField
Overrides:
getRelativeFieldNumber in class JDOFieldImplDynamic
Returns:
the relative field number

isDefaultFetchGroup

public boolean isDefaultFetchGroup()
Determines whether this JDOField is part of the default fetch group or not.

Specified by:
isDefaultFetchGroup in interface JDOField
Overrides:
isDefaultFetchGroup in class JDOFieldImplDynamic
Returns:
true if the field is part of the default fetch group, false otherwise

isEmbedded

public boolean isEmbedded()
Determines whether the field should be stored if possible as part of the instance instead of as its own instance in the datastore.

Specified by:
isEmbedded in interface JDOField
Overrides:
isEmbedded in class JDOFieldImplDynamic
Returns:
true if the field is stored as part of the instance; false otherwise

getRelationship

public JDORelationship getRelationship()
Get the relationship information for this JDOField. The method returns null if the field is not part of a relationship (e.g. it is a primitive type field).

Specified by:
getRelationship in interface JDOField
Overrides:
getRelationship in class JDOFieldImplDynamic
Returns:
relationship info of this JDOField or null if this JDOField is not a relationship

createJDOReference

public JDOReference createJDOReference()
                                throws ModelException
Creates and returns a new JDOReference instance. This method automatically binds the new JDOReference to this JDOField. It throws a ModelException, if this JDOField is already bound to another JDORelationship instance. Otherwise the following holds true:

Specified by:
createJDOReference in interface JDOField
Overrides:
createJDOReference in class JDOFieldImplDynamic
Returns:
a new JDOReference instance bound to this JDOField
Throws:
ModelException - if impossible

createJDOCollection

public JDOCollection createJDOCollection()
                                  throws ModelException
Creates and returns a new JDOCollection instance. This method automatically binds the new JDOCollection to this JDOField. It throws a ModelException, if this JDOField is already bound to another JDORelationship instance. Otherwise the following holds true:

Specified by:
createJDOCollection in interface JDOField
Overrides:
createJDOCollection in class JDOFieldImplDynamic
Returns:
a new JDOCollection instance bound to this JDOField
Throws:
ModelException - if impossible

createJDOArray

public JDOArray createJDOArray()
                        throws ModelException
Creates and returns a new JDOArray instance. This method automatically binds the new JDOArray to this JDOField. It throws a ModelException, if this JDOField is already bound to another JDORelationship instance. Otherwise the following holds true:

Specified by:
createJDOArray in interface JDOField
Overrides:
createJDOArray in class JDOFieldImplDynamic
Returns:
a new JDOArray instance bound to this JDOField
Throws:
ModelException - if impossible

createJDOMap

public JDOMap createJDOMap()
                    throws ModelException
Creates and returns a new JDOMap instance. This method automatically binds the new JDOMap to this JDOField. It throws a ModelException, if this JDOField is already bound to another JDORelationship instance. Otherwise the following holds true:

Specified by:
createJDOMap in interface JDOField
Overrides:
createJDOMap in class JDOFieldImplDynamic
Returns:
a new JDOMap instance bound to this JDOField
Throws:
ModelException - if impossible

createJDOCollectionInternal

protected JDOCollection createJDOCollectionInternal()
Creates and returns a new JDOCollection instance. This method automatically this JDOField as the declarinmg field of the returned instance.

Overrides:
createJDOCollectionInternal in class JDOFieldImplDynamic
Returns:
a new JDOCollection instance bound to this JDOField

createJDOArrayInternal

protected JDOArray createJDOArrayInternal()
Creates and returns a new JDOArray instance. This method automatically this JDOField as the declarinmg field of the returned instance.

Overrides:
createJDOArrayInternal in class JDOFieldImplDynamic
Returns:
a new JDOArray instance bound to this JDOField

createJDOMapInternal

protected JDOMap createJDOMapInternal()
Creates and returns a new JDOMap instance. This method automatically this JDOField as the declarinmg field of the returned instance.

Overrides:
createJDOMapInternal in class JDOFieldImplDynamic
Returns:
a new JDOMap instance bound to this JDOField


Copyright © 2005 Apache Software Foundation. All Rights Reserved.