org.apache.jdo.impl.model.jdo
Class JDOMapImplDynamic

java.lang.Object
  extended by org.apache.jdo.impl.model.jdo.JDOElementImpl
      extended by org.apache.jdo.impl.model.jdo.JDORelationshipImpl
          extended by org.apache.jdo.impl.model.jdo.JDOMapImplDynamic
All Implemented Interfaces:
JDOElement, JDOMap, JDORelationship
Direct Known Subclasses:
JDOMapImplCaching

public class JDOMapImplDynamic
extends JDORelationshipImpl
implements JDOMap

An instance of this class represents the JDO relationship metadata (the treatment of keys and values) of a map relationship field. This dynamic implementation only stores property values explicitly set by setter method.

Since:
1.1
Version:
1.1
Author:
Michael Bouschen

Field Summary
protected  java.lang.Boolean embeddedKey
          Property embeddedKey.
protected  java.lang.Boolean embeddedValue
          Property embeddedValue.
protected  JavaType keyType
          Property keyType.
protected  JavaType valueType
          Property valueType.
 
Fields inherited from class org.apache.jdo.impl.model.jdo.JDORelationshipImpl
inverse, mappedBy
 
Fields inherited from interface org.apache.jdo.model.jdo.JDORelationship
CARDINALITY_N, CARDINALITY_ONE, CARDINALITY_ZERO
 
Constructor Summary
JDOMapImplDynamic()
           
 
Method Summary
 JavaType getKeyType()
          Get the type representation of the keys for this JDOMap.
 java.lang.String getKeyTypeName()
          Get the string representation of the type of the keys for this JDOMap.
 JavaType getRelatedJavaType()
          Get the type representation of the relationship.
 JavaType getValueType()
          Get the type representation of the values for this JDOMap.
 java.lang.String getValueTypeName()
          Get the string representation of the type of the values for this JDOMap.
 boolean isEmbeddedKey()
          Determines whether the keys of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.
 boolean isEmbeddedValue()
          Determines whether the values of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.
 boolean isJDOMap()
          Determines whether this JDORelationship represents a map relationship or not.
 void setEmbeddedKey(boolean embeddedKey)
          Set whether the keys of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.
 void setEmbeddedValue(boolean embeddedValue)
          Set whether the values of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.
 void setKeyType(JavaType keyType)
          Set the type representation of the keys for this JDOMap.
 void setKeyTypeName(java.lang.String keyTypeName)
          Set string representation of the type of the keys for this JDOMap.
 void setValueType(JavaType valueType)
          Set the type representation of the values for this JDOMap.
 void setValueTypeName(java.lang.String valueTypeName)
          Set string representation of the type of the values for this JDOMap.
 
Methods inherited from class org.apache.jdo.impl.model.jdo.JDORelationshipImpl
getDeclaringField, getInverseRelationship, getInverseRelationshipName, getLowerBound, getMappedBy, getRelatedJDOClass, getUpperBound, isJDOArray, isJDOCollection, isJDOReference, isOwner, setDeclaringField, setInverseRelationship, setLowerBound, setMappedBy, setUpperBound
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jdo.model.jdo.JDORelationship
getDeclaringField, getInverseRelationship, getInverseRelationshipName, getLowerBound, getMappedBy, getRelatedJDOClass, getUpperBound, isJDOArray, isJDOCollection, isJDOReference, isOwner, setDeclaringField, setInverseRelationship, setLowerBound, setMappedBy, setUpperBound
 
Methods inherited from interface org.apache.jdo.model.jdo.JDOElement
addPropertyChangeListener, addVetoableChangeListener, createJDOExtension, getJDOExtensions, removeJDOExtension, removePropertyChangeListener, removeVetoableChangeListener
 

Field Detail

embeddedKey

protected java.lang.Boolean embeddedKey
Property embeddedKey.


keyType

protected transient JavaType keyType
Property keyType. No default.


embeddedValue

protected java.lang.Boolean embeddedValue
Property embeddedValue.


valueType

protected transient JavaType valueType
Property valueType. No default.

Constructor Detail

JDOMapImplDynamic

public JDOMapImplDynamic()
Method Detail

isEmbeddedKey

public boolean isEmbeddedKey()
Determines whether the keys of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.

Specified by:
isEmbeddedKey in interface JDOMap
Returns:
true if the keys are stored as part of this instance; false otherwise

setEmbeddedKey

public void setEmbeddedKey(boolean embeddedKey)
Set whether the keys of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.

Specified by:
setEmbeddedKey in interface JDOMap
Parameters:
embeddedKey - true if the keys are stored as part of this instance; false otherwise

getKeyType

public JavaType getKeyType()
Get the type representation of the keys for this JDOMap.

Specified by:
getKeyType in interface JDOMap
Returns:
the type of the keys of this JDOMap

setKeyType

public void setKeyType(JavaType keyType)
Set the type representation of the keys for this JDOMap.

Specified by:
setKeyType in interface JDOMap
Parameters:
keyType - the type representation of the keys

getKeyTypeName

public java.lang.String getKeyTypeName()
Get the string representation of the type of the keys for this JDOMap.

Specified by:
getKeyTypeName in interface JDOMap
Returns:
the key type as string

setKeyTypeName

public void setKeyTypeName(java.lang.String keyTypeName)
Set string representation of the type of the keys for this JDOMap.

Specified by:
setKeyTypeName in interface JDOMap
Parameters:
keyTypeName - the name of the key type

isEmbeddedValue

public boolean isEmbeddedValue()
Determines whether the values of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.

Specified by:
isEmbeddedValue in interface JDOMap
Returns:
true if the values are stored as part of this instance; false otherwise

setEmbeddedValue

public void setEmbeddedValue(boolean embeddedValue)
Set whether the values of the map should be stored if possible as part of the instance instead of as their own instances in the datastore.

Specified by:
setEmbeddedValue in interface JDOMap
Parameters:
embeddedValue - true if the values are stored as part of this instance; false otherwise

getValueType

public JavaType getValueType()
Get the type representation of the values for this JDOMap.

Specified by:
getValueType in interface JDOMap
Returns:
the type of the values of this JDOMap

setValueType

public void setValueType(JavaType valueType)
Set the type representation of the values for this JDOMap.

Specified by:
setValueType in interface JDOMap
Parameters:
valueType - the type representation of the values

getValueTypeName

public java.lang.String getValueTypeName()
Get the string representation of the type of the values for this JDOMap.

Specified by:
getValueTypeName in interface JDOMap
Returns:
the key value as string

setValueTypeName

public void setValueTypeName(java.lang.String valueTypeName)
Set string representation of the type of the values for this JDOMap.

Specified by:
setValueTypeName in interface JDOMap
Parameters:
valueTypeName - the name of the value type

isJDOMap

public boolean isJDOMap()
Determines whether this JDORelationship represents a map relationship or not. A return of true means this JDORelationship is a JDOMap instance.

Specified by:
isJDOMap in interface JDORelationship
Overrides:
isJDOMap in class JDORelationshipImpl
Returns:
true if this JDORelationship represents a map relationship; false otherwise.

getRelatedJavaType

public JavaType getRelatedJavaType()
Get the type representation of the relationship. This will be the JavaType for references, the element type for collections and arrays, and the value type for maps.

Specified by:
getRelatedJavaType in class JDORelationshipImpl
Returns:
the relationship type


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.