org.objectweb.jorm.mapper.rdb.metainfo
Class RdbInheritanceQuery

java.lang.Object
  extended byorg.objectweb.jorm.metainfo.lib.BasicMetaObject
      extended byorg.objectweb.jorm.mapper.rdb.metainfo.RdbInheritanceQuery
All Implemented Interfaces:
Loggable, MetaObject, java.io.Serializable

public class RdbInheritanceQuery
extends BasicMetaObject

This class stores two queries in String format: a query with prefetch a query without prefetch These queries retrieve the Extent of a class in case of inheritance. The list of fields to select is also stored as a collection of String.

Author:
Y.Bersihand
See Also:
Serialized Form

Field Summary
static java.lang.String PK
           
 
Fields inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
debug, logger, loggerFactory, parent
 
Constructor Summary
RdbInheritanceQuery(MetaObject parent)
           
 
Method Summary
 void addFieldPKAndFields(java.util.Collection c)
          Adds all the fields of the collection c to the fieldsPKAndFields list.
 void addFieldPKOnly(java.util.Collection c)
          Adds all the fields of the collection c to the fieldsPKOnly list.
 void addFieldPrefetch(java.util.Collection fields, java.util.Collection classes)
          Adds all the fields of the collection fields to the fieldsPrefetch list.
 java.util.Collection getExtentFieldsNames(boolean prefetch, boolean pkOnly)
          Returns the list of fields to be selected.
 java.lang.String getExtentQuery(PMapper mapper, boolean prefetch, boolean pkOnly, java.lang.String primaryKey, PClassMapping pcm)
          Returns the query of the extent as a String.
 java.util.Collection getPKfield()
           
 void setSubTreeFieldAssociationTable(PMapper mapper, PClassMapping pcm)
          For each subclass of the class linked to the pcm (including itself), compute the association table of field indexes and add the element [pcm -> table] in the map of the subclass PClassMapping
 
Methods inherited from class org.objectweb.jorm.metainfo.lib.BasicMetaObject
getChildren, getLogger, getLoggerFactory, getManager, getParent, setLogger, setLoggerFactory, setLoggingOnChild, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PK

public static final java.lang.String PK
See Also:
Constant Field Values
Constructor Detail

RdbInheritanceQuery

public RdbInheritanceQuery(MetaObject parent)
Method Detail

getExtentQuery

public java.lang.String getExtentQuery(PMapper mapper,
                                       boolean prefetch,
                                       boolean pkOnly,
                                       java.lang.String primaryKey,
                                       PClassMapping pcm)
Returns the query of the extent as a String.


getPKfield

public java.util.Collection getPKfield()

getExtentFieldsNames

public java.util.Collection getExtentFieldsNames(boolean prefetch,
                                                 boolean pkOnly)
Returns the list of fields to be selected.


addFieldPKOnly

public void addFieldPKOnly(java.util.Collection c)
Adds all the fields of the collection c to the fieldsPKOnly list. If one the fields is already present in the list, it is not added a second time.


addFieldPrefetch

public void addFieldPrefetch(java.util.Collection fields,
                             java.util.Collection classes)
Adds all the fields of the collection fields to the fieldsPrefetch list. If one the fields is already present in the list, it is not added a second time. In the same time, classes associated to these added fields are added to the prefetchClasses list.


addFieldPKAndFields

public void addFieldPKAndFields(java.util.Collection c)
Adds all the fields of the collection c to the fieldsPKAndFields list. If one the fields is already present in the list, it is not added a second time.


setSubTreeFieldAssociationTable

public void setSubTreeFieldAssociationTable(PMapper mapper,
                                            PClassMapping pcm)
For each subclass of the class linked to the pcm (including itself), compute the association table of field indexes and add the element [pcm -> table] in the map of the subclass PClassMapping