org.objectweb.speedo.metadata
Class SpeedoClass

java.lang.Object
  extended byorg.objectweb.speedo.metadata.SpeedoElement
      extended byorg.objectweb.speedo.metadata.SpeedoClass

public class SpeedoClass
extends SpeedoElement

Describes a persistence capable class.

Author:
S.Chassande-Barrioz

Field Summary
 boolean classAlreadyEnhanced
           
 ClassCode classCode
          Descriptor of this class code.
 SpeedoDatastoreId datastoreId
          The datastore-id.
 java.lang.String datastoreSequence
          The name of the datastore sequence
 boolean failed
          Indicates whether something goes wrong during the JDO Instances generation.
 byte identityType
          Attribute identity-type.
 byte inheritanceStrategy
           
 boolean isAbstract
          Indicates if the class is abstract.
 boolean isDetachable
          Attribute detachable.
 boolean isInstanceCallbacks
          Indicates if the class implements InstanceCallbacks
 boolean isSerializable
          Indicates if the class implements InstanceCallbacks
 java.util.Map jdoFetchGroup
          Description of fetchgroups defined for this class.
 java.util.Map jdoField
          Description of persistent capable fields of this class.
 SpeedoPackage jdoPackage
          Description of the package which contains this class.
 org.objectweb.jorm.metainfo.api.Class jormclass
          Class jorm corresponding to this jdoclass
 java.lang.String name
          Class name.
 java.util.Map name2query
           
static byte NEW_TABLE
           
static byte NO_NO_ARG_CONSTRUCTOR
           
 byte noArgConstructorStatus
           
static byte NON_PUBLIC_NO_ARG_CONSTRUCTOR
           
 java.lang.String objectidClass
          Attribute objectid-class.
static byte PUBLIC_NO_ARG_CONSTRUCTOR
           
 boolean requireEnhancement
           
 boolean requiresExtent
          Attribute requires-extent.
 java.lang.String signature
          Class signature.
static byte SUBCLASS_TABLE
           
static byte SUPERCLASS_TABLE
           
 java.lang.String superClassName
          Super class name.
 SpeedoVersion version
          Description of the version.
 long VersionUID
          Version UID for serialization.
 
Fields inherited from class org.objectweb.speedo.metadata.SpeedoElement
jdoExtension
 
Constructor Summary
SpeedoClass()
           
 
Method Summary
 void add(java.lang.Object field)
          Adds a SpeedoField to the class.
 void add(java.lang.Object field, boolean failsOnError, org.objectweb.util.monolog.api.Logger logger)
          Adds a SpeedoField to the class.
 void addDatastoreId(java.lang.Object datastoreId)
           
 void addFetchGroup(java.lang.Object fetchGroup)
          Adds a SpeedoFetchGroup to the class.
 void addFetchGroup(java.lang.Object fetchGroup, boolean failsOnError, org.objectweb.util.monolog.api.Logger logger)
          Adds a SpeedoFetchgroup to the class.
 void addVersion(java.lang.Object version)
          Set the versioning strategy of the class.
 int computeFieldNumbers()
          Computes the field numbers for the fields of this class.
 boolean generateObjectId()
           
 SpeedoClass getAncestor()
           
 java.lang.String getFQName()
           
 java.lang.String getJDOFileName()
           
 java.lang.String getJormFileName()
           
 int getPkFieldCount()
           
 SpeedoClass getSpeedoClassFromContext(java.lang.String className)
           
 SpeedoClass getSuper()
           
 java.lang.String toString()
          Transforms a SpeedoClass into a String.
 
Methods inherited from class org.objectweb.speedo.metadata.SpeedoElement
addExtension, getExtension, getExtensionByKey, getExtensionValueByKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Class name.


identityType

public byte identityType
Attribute identity-type.


version

public SpeedoVersion version
Description of the version.


datastoreId

public SpeedoDatastoreId datastoreId
The datastore-id.


objectidClass

public java.lang.String objectidClass
Attribute objectid-class.


requiresExtent

public boolean requiresExtent
Attribute requires-extent.


isDetachable

public boolean isDetachable
Attribute detachable.


superClassName

public java.lang.String superClassName
Super class name.


jdoField

public java.util.Map jdoField
Description of persistent capable fields of this class. The HashMap key is the field name.


jdoFetchGroup

public java.util.Map jdoFetchGroup
Description of fetchgroups defined for this class. The HashMap key is the field name.


classCode

public ClassCode classCode
Descriptor of this class code.


jdoPackage

public SpeedoPackage jdoPackage
Description of the package which contains this class.


isAbstract

public boolean isAbstract
Indicates if the class is abstract.


isInstanceCallbacks

public boolean isInstanceCallbacks
Indicates if the class implements InstanceCallbacks


isSerializable

public boolean isSerializable
Indicates if the class implements InstanceCallbacks


signature

public java.lang.String signature
Class signature.


VersionUID

public long VersionUID
Version UID for serialization.


failed

public boolean failed
Indicates whether something goes wrong during the JDO Instances generation.


jormclass

public org.objectweb.jorm.metainfo.api.Class jormclass
Class jorm corresponding to this jdoclass


datastoreSequence

public java.lang.String datastoreSequence
The name of the datastore sequence


classAlreadyEnhanced

public boolean classAlreadyEnhanced

requireEnhancement

public boolean requireEnhancement

name2query

public java.util.Map name2query

NO_NO_ARG_CONSTRUCTOR

public static final byte NO_NO_ARG_CONSTRUCTOR
See Also:
Constant Field Values

NON_PUBLIC_NO_ARG_CONSTRUCTOR

public static final byte NON_PUBLIC_NO_ARG_CONSTRUCTOR
See Also:
Constant Field Values

PUBLIC_NO_ARG_CONSTRUCTOR

public static final byte PUBLIC_NO_ARG_CONSTRUCTOR
See Also:
Constant Field Values

noArgConstructorStatus

public byte noArgConstructorStatus

SUBCLASS_TABLE

public static final byte SUBCLASS_TABLE
See Also:
Constant Field Values

NEW_TABLE

public static final byte NEW_TABLE
See Also:
Constant Field Values

SUPERCLASS_TABLE

public static final byte SUPERCLASS_TABLE
See Also:
Constant Field Values

inheritanceStrategy

public byte inheritanceStrategy
Constructor Detail

SpeedoClass

public SpeedoClass()
Method Detail

getFQName

public java.lang.String getFQName()

toString

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

Returns:
the Sting corresponding to the SpeedoClass.

add

public void add(java.lang.Object field)
Adds a SpeedoField to the class. Precondition: this field doesn't exist in the jdoFields HashMap.

Parameters:
field - field to add.

add

public void add(java.lang.Object field,
                boolean failsOnError,
                org.objectweb.util.monolog.api.Logger logger)
         throws SpeedoException
Adds a SpeedoField to the class.

Parameters:
field - field to add.
failsOnError - if an error must be thrown or creates a warning.
logger - logger for writting warn message if necessary.
Throws:
SpeedoException - if the field was already defined into the class.

addVersion

public void addVersion(java.lang.Object version)
Set the versioning strategy of the class.

Parameters:
version - : the version to set

addDatastoreId

public void addDatastoreId(java.lang.Object datastoreId)

addFetchGroup

public void addFetchGroup(java.lang.Object fetchGroup)
Adds a SpeedoFetchGroup to the class. Precondition: this fetchgroup doesn't exist in the jdoFtechGroups HashMap.

Parameters:
fetchGroup - the fetchgroup to add.

addFetchGroup

public void addFetchGroup(java.lang.Object fetchGroup,
                          boolean failsOnError,
                          org.objectweb.util.monolog.api.Logger logger)
                   throws SpeedoException
Adds a SpeedoFetchgroup to the class.

Parameters:
fetchGroup - the fetchgroup to add.
failsOnError - if an error must be thrown or creates a warning.
logger - logger for writting warn message if necessary.
Throws:
SpeedoException - if the field was already defined into the class.

computeFieldNumbers

public int computeFieldNumbers()
Computes the field numbers for the fields of this class.

Returns:
the number of fields of this class (including inherited fields).

getJormFileName

public java.lang.String getJormFileName()

generateObjectId

public boolean generateObjectId()

getPkFieldCount

public int getPkFieldCount()

getSpeedoClassFromContext

public SpeedoClass getSpeedoClassFromContext(java.lang.String className)

getJDOFileName

public java.lang.String getJDOFileName()

getSuper

public SpeedoClass getSuper()

getAncestor

public SpeedoClass getAncestor()