org.objectweb.speedo.metadata
Class SpeedoField

java.lang.Object
  extended by org.objectweb.speedo.metadata.SpeedoElement
      extended by org.objectweb.speedo.metadata.SpeedoCommonField
          extended by org.objectweb.speedo.metadata.SpeedoField
All Implemented Interfaces:
java.io.Serializable

public class SpeedoField
extends SpeedoCommonField

This class corresponds to the description of persistent fields.

Author:
S.Chassande-Barrioz
See Also:
Serialized Form

Field Summary
 boolean defaultFetchGroup
          This boolean indicates if the field is in the default fetch group.
 int depth
          Recursive fetchgroups are controlled by the depth attribute.
 boolean embedded
          Attribute embedded of the XML file.
 java.lang.String fetchGroup
           
 boolean isCascadeDelete
          Indicates if the field has to be deleted when its referencer is deleted.
 boolean isCoherentReverseField
          Indicates if the coherence of bidirectional relationship must be assumed by Speedo.
static byte MANY_MANY_BI_RELATION
           
static byte MANY_ONE_BI_RELATION
           
static byte MANY_REFERENCE
           
 boolean mappedByReversefield
          In case of bi directional relationship the mapping of this field can be defined since the mapping of the reverse field.
static byte NO_BI_RELATION
           
static byte NONE
           
 byte nullValue
          Attribute null-value in the XML file.
 int number
          is the index of the persistent field.
static byte ONE_MANY_BI_RELATION
           
static byte ONE_ONE_BI_RELATION
           
static byte ONE_REFERENCE
           
static java.lang.String[] PERSISTENCE_STATUS
           
 byte persistenceStatus
          Attribute persistence-modifier in the XML file.
static byte PERSISTENT
           
 boolean primaryKey
          Boolean indicating if the field is a primary key.
static byte PROPAG_ALL
           
static byte PROPAG_MERGE
           
static byte PROPAG_NONE
           
static byte PROPAG_PERSIST
           
static byte PROPAG_REFRESH
           
static byte PROPAG_REMOVE
           
 byte propagate
          Specify the kind of persistence characteristic should be propagated through this field (PERSIST | MERGE | REMOVE | REFRESH).
 byte relationType
          Type of the relation containinig the persistent field
 java.lang.String reverseField
          Is the name of the field which composes with the current field, a bidirectional relation ship.
 java.lang.String sequence
          Attribute sequence
 java.lang.String type
          Type of the persistent field
static byte UNKNOWN
           
 java.lang.String valueStrategy
          Attribute value-strategy
 int visibility
          visibility of the field (public | protected | private | static ...)
 
Fields inherited from class org.objectweb.speedo.metadata.SpeedoCommonField
columns, jdoTuple, join, moClass, name
 
Fields inherited from class org.objectweb.speedo.metadata.SpeedoElement
jdoExtension, personality
 
Constructor Summary
SpeedoField()
           
 
Method Summary
 void addColumn(SpeedoColumn col)
           
 java.lang.String getClassName()
           
 SpeedoField getFieldOfTheReferencedClass(java.lang.String fieldName)
           
 SpeedoClass getReferencedClass()
           
 SpeedoField getReverseField()
           
 java.lang.String getSourceDesc()
           
 java.lang.String modifier()
          Returns the field's modifier
static java.lang.String parsePersistenceStatus(byte ps)
           
static byte parsePersistenceStatus(java.lang.String s)
           
 java.lang.String privateSignature()
          Returns the field's signature with a private modifier.
 java.lang.String publicSignature()
          Returns the field's signature with a public modifier.
 java.lang.String toString()
          Transforms a SpeedoField into a String.
 java.lang.String type()
          Returns the type of the field.
 
Methods inherited from class org.objectweb.speedo.metadata.SpeedoCommonField
getFKColumn, getFKJoinColumn, getFQFieldName, getJoinColumn, printColumns
 
Methods inherited from class org.objectweb.speedo.metadata.SpeedoElement
addExtension, addInArray, getExtension, getExtensionByKey, getExtensionValueByKey, indexOfInArray, removeInArray, setValueInArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPAG_NONE

public static final byte PROPAG_NONE
See Also:
Constant Field Values

PROPAG_PERSIST

public static final byte PROPAG_PERSIST
See Also:
Constant Field Values

PROPAG_MERGE

public static final byte PROPAG_MERGE
See Also:
Constant Field Values

PROPAG_REMOVE

public static final byte PROPAG_REMOVE
See Also:
Constant Field Values

PROPAG_REFRESH

public static final byte PROPAG_REFRESH
See Also:
Constant Field Values

PROPAG_ALL

public static final byte PROPAG_ALL
See Also:
Constant Field Values

NO_BI_RELATION

public static final byte NO_BI_RELATION
See Also:
Constant Field Values

ONE_ONE_BI_RELATION

public static final byte ONE_ONE_BI_RELATION
See Also:
Constant Field Values

ONE_MANY_BI_RELATION

public static final byte ONE_MANY_BI_RELATION
See Also:
Constant Field Values

MANY_ONE_BI_RELATION

public static final byte MANY_ONE_BI_RELATION
See Also:
Constant Field Values

MANY_MANY_BI_RELATION

public static final byte MANY_MANY_BI_RELATION
See Also:
Constant Field Values

ONE_REFERENCE

public static final byte ONE_REFERENCE
See Also:
Constant Field Values

MANY_REFERENCE

public static final byte MANY_REFERENCE
See Also:
Constant Field Values

UNKNOWN

public static final byte UNKNOWN
See Also:
Constant Field Values

NONE

public static final byte NONE
See Also:
Constant Field Values

PERSISTENT

public static final byte PERSISTENT
See Also:
Constant Field Values

PERSISTENCE_STATUS

public static final java.lang.String[] PERSISTENCE_STATUS

visibility

public int visibility
visibility of the field (public | protected | private | static ...)

See Also:
Constants.ACC_PUBLIC, Constants.ACC_PRIVATE, Constants.ACC_PROTECTED, Constants.ACC_STATIC, Constants.ACC_FINAL, Constants.ACC_TRANSIENT

propagate

public byte propagate
Specify the kind of persistence characteristic should be propagated through this field (PERSIST | MERGE | REMOVE | REFRESH).

See Also:
PROPAG_ALL, PROPAG_PERSIST, PROPAG_MERGE, PROPAG_REMOVE, PROPAG_REFRESH, PROPAG_NONE

type

public java.lang.String type
Type of the persistent field

See Also:
Type.getDescriptor()

number

public int number
is the index of the persistent field. This field is computed through a MI visitor.


persistenceStatus

public byte persistenceStatus
Attribute persistence-modifier in the XML file.


primaryKey

public boolean primaryKey
Boolean indicating if the field is a primary key.


nullValue

public byte nullValue
Attribute null-value in the XML file.


defaultFetchGroup

public boolean defaultFetchGroup
This boolean indicates if the field is in the default fetch group. (not managed)


depth

public int depth
Recursive fetchgroups are controlled by the depth attribute. A depth of 0 (the default) will fetch the whole graph of instances reachable from this field.


fetchGroup

public java.lang.String fetchGroup

embedded

public boolean embedded
Attribute embedded of the XML file. (not managed)


valueStrategy

public java.lang.String valueStrategy
Attribute value-strategy


sequence

public java.lang.String sequence
Attribute sequence


relationType

public byte relationType
Type of the relation containinig the persistent field

See Also:
NO_BI_RELATION, ONE_ONE_BI_RELATION, ONE_MANY_BI_RELATION, MANY_ONE_BI_RELATION, MANY_MANY_BI_RELATION

reverseField

public java.lang.String reverseField
Is the name of the field which composes with the current field, a bidirectional relation ship.


isCoherentReverseField

public boolean isCoherentReverseField
Indicates if the coherence of bidirectional relationship must be assumed by Speedo.


isCascadeDelete

public boolean isCascadeDelete
Indicates if the field has to be deleted when its referencer is deleted.


mappedByReversefield

public boolean mappedByReversefield
In case of bi directional relationship the mapping of this field can be defined since the mapping of the reverse field. In this case the #columns field is null and this field is equals to 'true'.

See Also:
SpeedoCommonField.columns, SpeedoCommonField.join
Constructor Detail

SpeedoField

public SpeedoField()
Method Detail

parsePersistenceStatus

public static byte parsePersistenceStatus(java.lang.String s)
Parameters:
s - is a string representation of a persistence status
Returns:
the constant value corresponding to the persistence status.

parsePersistenceStatus

public static java.lang.String parsePersistenceStatus(byte ps)

toString

public java.lang.String toString()
Transforms a SpeedoField into a String.

Overrides:
toString in class java.lang.Object
Returns:
the String corresponding to the SpeedoField.

publicSignature

public java.lang.String publicSignature()
Returns the field's signature with a public modifier.

Returns:
the String containing the field' signature with a public modifier.

privateSignature

public java.lang.String privateSignature()
Returns the field's signature with a private modifier.

Returns:
the String containing the field' signature with a private modifier.

modifier

public java.lang.String modifier()
Returns the field's modifier

Returns:
the String representing the modifier (public, private, protected)

type

public java.lang.String type()
Returns the type of the field.

Returns:
type of the field.

getReverseField

public SpeedoField getReverseField()
                            throws SpeedoException
Throws:
SpeedoException

getFieldOfTheReferencedClass

public SpeedoField getFieldOfTheReferencedClass(java.lang.String fieldName)
                                         throws SpeedoException
Throws:
SpeedoException

getSourceDesc

public java.lang.String getSourceDesc()
Overrides:
getSourceDesc in class SpeedoCommonField

addColumn

public void addColumn(SpeedoColumn col)
Overrides:
addColumn in class SpeedoCommonField

getClassName

public java.lang.String getClassName()

getReferencedClass

public SpeedoClass getReferencedClass()