org.objectweb.jorm.mapper.rdb.genclass
Class RdbGenClassMapping

java.lang.Object
  |
  +--org.objectweb.jorm.genclass.lib.GenClassMapping
        |
        +--org.objectweb.jorm.mapper.rdb.genclass.RdbGenClassMapping
All Implemented Interfaces:
GenClassProp, Loggable, PClassMapping, PClassMappingCtrl, RdbGenClassProp

public class RdbGenClassMapping
extends GenClassMapping
implements RdbGenClassProp

This class provides the implementation of PClassMapping for RDBMS.

Author:
P. D?chamboux

Nested Class Summary
 
Nested classes inherited from class org.objectweb.jorm.api.PClassMapping
PClassMapping.ReferenceConfigurator
 
Field Summary
protected  boolean colocated
           
protected  boolean colocatedMaster
           
protected  boolean readOnly
           
protected  java.lang.String tableName
          The name of the table into which to store generic class object elements.
protected  RdbAdapter typeConverter
          This is the type converter defined for a particular kind of RDB.
protected  boolean useBatch
           
 
Fields inherited from class org.objectweb.jorm.genclass.lib.GenClassMapping
binder, elemClassMapping, elemFields, elemNameCoder, genClassMetaInfo, genClassPType, identifierFields, indexFields, jormClassName, logger, loggerFactory, mapper, projectName
 
Fields inherited from interface org.objectweb.jorm.api.PClassMapping
CLEANUP_DONOTHING, CLEANUP_REMOVEALL, CLEANUP_REMOVEDATA, CREATE_STRUCTURE_IF_NEEDED
 
Constructor Summary
RdbGenClassMapping()
           
 
Method Summary
 PBinding createPBinding()
          It creates a new PBinding.
 java.util.Iterator getPNameIterator(java.lang.Object conn)
          It returns an iterator over all pname of persitent objects availlable in this class.
 void init(PMappingCallback mapper, MetaObject metaclass)
          It intialises the class mapping.
 boolean isConform(java.lang.String mappername)
          It specifies if the given kind of PMapper is supported by this PClassMapping.
 void setColocated(boolean colocated)
          Indicates if the table of the genclass is colocated
 void setColocatedMaster(boolean cm)
          Indicates if the table of the genclass is colocated
 void setReadOnly(boolean readonly)
          Indicates if the table must be only read.
 void setTableName(java.lang.String tn)
          Defines the table name property of a generic class instance mapped to a RDB.
 void setTypeConverter(RdbAdapter tc)
          Defines the type converter property of a generic class instance mapped to a RDB.
 
Methods inherited from class org.objectweb.jorm.genclass.lib.GenClassMapping
configureRefFields, getClassName, getElemFields, getGenClassMapping, getGenClassMapping, getIdentifierFields, getIndexFields, getLogger, getLoggerFactory, getMetaInfo, getPBinder, getPMapper, getPNameCoder, getPNameCoder, getProjectName, getPType, setElemDesc, setGenClassMapping, setGenClassMapping, setIdentifierDesc, setIndexDesc, setLogger, setLoggerFactory, setPBinder, setPNameCoder, setPNameCoder, setProjectName, setPType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.genclass.api.GenClassProp
setElemDesc, setIdentifierDesc, setIndexDesc, setPType
 

Field Detail

tableName

protected java.lang.String tableName
The name of the table into which to store generic class object elements. It should be null in case of "legacy" mapping.


typeConverter

protected RdbAdapter typeConverter
This is the type converter defined for a particular kind of RDB.


useBatch

protected boolean useBatch

colocated

protected boolean colocated

colocatedMaster

protected boolean colocatedMaster

readOnly

protected boolean readOnly
Constructor Detail

RdbGenClassMapping

public RdbGenClassMapping()
Method Detail

createPBinding

public PBinding createPBinding()
                        throws PException
It creates a new PBinding.

Specified by:
createPBinding in interface PClassMapping
Returns:
The new PBinding with lifecycle state set to LIFECYCLE_NOTBOUND.
PException

getPNameIterator

public java.util.Iterator getPNameIterator(java.lang.Object conn)
                                    throws PExceptionProtocol,
                                           PExceptionIO
It returns an iterator over all pname of persitent objects availlable in this class. When you use the returned iterator you must leave the connection opened.

Specified by:
getPNameIterator in interface PClassMapping
Parameters:
conn - is the connection which permits to access to the support
Returns:
the iterator over PName objects
Throws:
PExceptionProtocol - A problem occured during the request that is not related to I/O.
PExceptionIO - A problem occured during the request.

isConform

public boolean isConform(java.lang.String mappername)
It specifies if the given kind of PMapper is supported by this PClassMapping. In this case, all kinds of RDB mappers are supported.

Specified by:
isConform in interface PClassMapping
Parameters:
mappername - The name defining the PMapper kind.
Returns:
true if this kind of mapper is supported.

setTableName

public void setTableName(java.lang.String tn)
Defines the table name property of a generic class instance mapped to a RDB.

Specified by:
setTableName in interface RdbGenClassProp
Parameters:
tn - The associated type.

setColocated

public void setColocated(boolean colocated)
Description copied from interface: RdbGenClassProp
Indicates if the table of the genclass is colocated

Specified by:
setColocated in interface RdbGenClassProp

setColocatedMaster

public void setColocatedMaster(boolean cm)
Description copied from interface: RdbGenClassProp
Indicates if the table of the genclass is colocated

Specified by:
setColocatedMaster in interface RdbGenClassProp

setReadOnly

public void setReadOnly(boolean readonly)
Description copied from interface: RdbGenClassProp
Indicates if the table must be only read.

Specified by:
setReadOnly in interface RdbGenClassProp
Parameters:
readonly -

setTypeConverter

public void setTypeConverter(RdbAdapter tc)
Defines the type converter property of a generic class instance mapped to a RDB.

Specified by:
setTypeConverter in interface RdbGenClassProp
Parameters:
tc - The associated type converter.

init

public void init(PMappingCallback mapper,
                 MetaObject metaclass)
          throws PException
It intialises the class mapping. It especially assigns a mapper as well as a meta-object describing either a class or a generic class.

Specified by:
init in interface PClassMapping
Overrides:
init in class GenClassMapping
Parameters:
mapper - The mapper to be assigned to this class mapping.
metaclass - The meta-object describing the associated class. It may be null.
PException