|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jorm.genclass.lib.GenClassMapping
org.objectweb.jorm.mapper.rdb.genclass.RdbGenClassMapping
This class provides the implementation of PClassMapping for RDBMS.
Nested Class Summary |
Nested classes inherited from class org.objectweb.jorm.api.PClassMapping |
PClassMapping.ReferenceConfigurator |
Field Summary | |
protected boolean |
colocated
|
protected boolean |
colocatedMaster
|
protected java.lang.String[] |
extCols
|
protected java.lang.String[] |
mainCols
|
protected int |
nbPrefetchCol
|
protected boolean |
prefetchActivated
|
protected RdbPrefetchablePCM |
prefetchedPCM
|
protected boolean |
readOnly
|
protected java.lang.String |
refExtTableName
|
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, classPNC, 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 | |
void |
addAssociation(PClassMapping targetClass,
int[] indexes)
Adds an association [pclassmapping-> table of indexes] to the association table. |
void |
classDefined(PMappingStructuresManager pmsm)
Register the class in the cluster. |
PBinding |
createPBinding()
It creates a new PBinding. |
void |
defineJoinColumns(java.lang.String[] maincols,
java.lang.String[] extcols)
Defines the two sets of columns that are used to join the main table with the extension table. |
boolean |
exist(PBinding pb,
java.lang.Object conn)
It verifies if the DSI attached to a binding exists within the DS. |
java.util.HashMap |
getAssociationTable()
Returns the map storing association between a pclassmapping on which is done a query and a table of int representing the fields numbers to select in the tuple to fill in the field of an instance of the class. |
PName |
getDecodedPName(TupleCollection tc,
PName pname,
boolean b)
It returns the PName valid in the "good" binder according to the tuple collection. |
int[] |
getIndexesTable(PClassMapping targetClass)
Returns the indexes table associated to the pclassmapping targetClass, null if not contained in the map. |
PNameIterator |
getPNameIterator(java.lang.Object conn,
boolean withSubType,
boolean prefetching,
java.lang.Object txctx)
It returns an iterator over all pname of persitent objects availlable in this class. |
PClassMapping[] |
getSubPCMs()
Returns null in case of genclass. |
void |
init(PMappingCallback mapper,
MetaObject metaclass)
It intialises the class mapping. |
void |
init(PMappingStructuresManager pmsm)
Register the mapping structures and the dependencies. |
boolean |
isConform(java.lang.String mappername)
It specifies if the given kind of PMapper is supported by this PClassMapping. |
boolean |
match(java.lang.Object obj,
boolean b)
Returns true if the object obj matches (exactly) this class, else it returns false. |
void |
read(PBinding pb,
java.lang.Object conn,
PAccessor pa)
It reads the data store instance designated by the PName of a binding and transfers each attribute value to the accessor object. |
void |
read(PBinding pb,
java.lang.Object conn,
PAccessor pa,
java.lang.Object txctx)
It reads the data store instance designated by the PName of a binding and transfers each attribute value to the accessor object. |
void |
read(PBinding pb,
java.lang.Object conn,
PAccessor pa,
java.lang.Object txctx,
boolean forUpudate)
|
PName |
resolve(java.lang.Object conn,
PName pname)
It returns the PName valid in the "good" binder. |
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 |
setPrefetchActivated(boolean prefetch)
|
void |
setPrefetchElementPCM(RdbPrefetchablePCM pcm)
Specify the PClassMapping of the persistent class which must be prefetched |
void |
setReadOnly(boolean readonly)
Indicates if the table must be only read. |
void |
setRefExtTableName(java.lang.String retn)
Defines the table name property of a generic class instance mapped to a RDB for a table that owns extension fields of a reference element. |
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. |
void |
write(PBinding pb,
java.lang.Object conn,
PAccessor pa)
It transfers each attribute value taken from the PAccessor object to the data store instance designated by the PName associated with a binding. |
Methods inherited from class org.objectweb.jorm.genclass.lib.GenClassMapping |
configureRefFields, getClassName, getClassPNameCoder, getElemFields, getGenClassMapping, getGenClassMapping, getIdentifierFields, getIndexFields, getLogger, getLoggerFactory, getMetaInfo, getPBinder, getPMapper, getPNameCoder, getPNameCoder, getPNameIterator, getProjectName, getPType, setClassPNameCoder, 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 |
protected java.lang.String tableName
protected java.lang.String refExtTableName
protected java.lang.String[] mainCols
protected java.lang.String[] extCols
protected RdbPrefetchablePCM prefetchedPCM
protected int nbPrefetchCol
protected boolean prefetchActivated
protected RdbAdapter typeConverter
protected boolean useBatch
protected boolean colocated
protected boolean colocatedMaster
protected boolean readOnly
Constructor Detail |
public RdbGenClassMapping()
Method Detail |
public void setPrefetchActivated(boolean prefetch)
public PBinding createPBinding() throws PException
createPBinding
in interface PClassMapping
PException
public PNameIterator getPNameIterator(java.lang.Object conn, boolean withSubType, boolean prefetching, java.lang.Object txctx) throws PException
getPNameIterator
in interface PClassMapping
conn
- is the connection which permits to access to the supportwithSubType
- indicates if the subclass instances must be included
into the iteratorprefetching
- indicates if prefething must be activated during the
query on the persistent support.txctx
- The transaction context that can be used in case of
prefetching.
PException
public PClassMapping[] getSubPCMs() throws PException
getSubPCMs
in interface PClassMapping
PException
public boolean isConform(java.lang.String mappername)
isConform
in interface PClassMapping
mappername
- The name defining the PMapper kind.
public boolean exist(PBinding pb, java.lang.Object conn) throws PException
PClassMapping
exist
in interface PClassMapping
pb
- is the PBinding instanceconn
- The connection that can be used to refer to the DS.
PException
public void read(PBinding pb, java.lang.Object conn, PAccessor pa) throws PException
PClassMapping
read
in interface PClassMapping
conn
- The connection that can be used to refer to the DS.pa
- The PAccessor used to access memory variables.
PException
public void read(PBinding pb, java.lang.Object conn, PAccessor pa, java.lang.Object txctx) throws PException
PClassMapping
read
in interface PClassMapping
read
in class GenClassMapping
PException
public void read(PBinding pb, java.lang.Object conn, PAccessor pa, java.lang.Object txctx, boolean forUpudate) throws PException
read
in interface PClassMapping
read
in class GenClassMapping
PException
public void write(PBinding pb, java.lang.Object conn, PAccessor pa) throws PException
PClassMapping
write
in interface PClassMapping
conn
- The connection that can be used to refer to the DS.pa
- The PAccessor used to access memory variables.
PException
public void setTableName(java.lang.String tn)
RdbGenClassProp
setTableName
in interface RdbGenClassProp
tn
- The table namepublic void setRefExtTableName(java.lang.String retn)
RdbGenClassProp
setRefExtTableName
in interface RdbGenClassProp
retn
- The table name of the extension fieldspublic void setColocated(boolean colocated)
RdbGenClassProp
setColocated
in interface RdbGenClassProp
public void setColocatedMaster(boolean cm)
RdbGenClassProp
setColocatedMaster
in interface RdbGenClassProp
public void setReadOnly(boolean readonly)
RdbGenClassProp
setReadOnly
in interface RdbGenClassProp
readonly
- public void setTypeConverter(RdbAdapter tc)
RdbGenClassProp
setTypeConverter
in interface RdbGenClassProp
tc
- The associated type.public void defineJoinColumns(java.lang.String[] maincols, java.lang.String[] extcols)
RdbGenClassProp
defineJoinColumns
in interface RdbGenClassProp
maincols
- Names of columns within the main table.extcols
- Names of columns within the extension table.public void setPrefetchElementPCM(RdbPrefetchablePCM pcm)
RdbGenClassProp
setPrefetchElementPCM
in interface RdbGenClassProp
public void init(PMappingCallback mapper, MetaObject metaclass) throws PException
init
in interface PClassMapping
init
in class GenClassMapping
mapper
- The mapper to be assigned to this class mapping.metaclass
- The meta-object describing the associated class. It may be
null.
PException
public java.util.HashMap getAssociationTable()
PClassMapping
getAssociationTable
in interface PClassMapping
public void addAssociation(PClassMapping targetClass, int[] indexes)
PClassMapping
addAssociation
in interface PClassMapping
targetClass
- the PClassMapping on which is done the queryindexes
- a table of int composed of the indexes of fields requiredpublic int[] getIndexesTable(PClassMapping targetClass)
PClassMapping
getIndexesTable
in interface PClassMapping
public PName resolve(java.lang.Object conn, PName pname) throws PException
PClassMapping
resolve
in interface PClassMapping
conn
- The connection that can be used to refer to the DS.
PException
public boolean match(java.lang.Object obj, boolean b) throws PException
PClassMapping
match
in interface PClassMapping
PException
public PName getDecodedPName(TupleCollection tc, PName pname, boolean b) throws PException
PClassMapping
getDecodedPName
in interface PClassMapping
PException
public void init(PMappingStructuresManager pmsm) throws PException
PClassMapping
init
in interface PClassMapping
pmsm
- The PMappingStructuresManager in which mapping structures
are registered.
PException
public void classDefined(PMappingStructuresManager pmsm) throws PException
PClassMapping
classDefined
in interface PClassMapping
pmsm
-
PException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |