org.objectweb.medor.query.jorm.lib
Class ClassExtent

java.lang.Object
  extended byorg.objectweb.medor.query.jorm.lib.BasicJormExtent
      extended byorg.objectweb.medor.query.jorm.lib.ClassExtent
All Implemented Interfaces:
Cloneable, java.lang.Cloneable, JormExtent, QueryLeaf, QueryTree, TupleStructure

public class ClassExtent
extends BasicJormExtent

This class represents the extent of a JORM class. It contains and implements its associated TupleStructure.


Field Summary
 
Fields inherited from class org.objectweb.medor.query.jorm.lib.BasicJormExtent
fields, identifier, includeSubclasses, mapper, myStore, name, name2field, pnFieldName, projectName
 
Constructor Summary
ClassExtent(java.lang.Class jormClass, java.lang.String _name, java.lang.String[] fieldNames, boolean addPName, java.lang.String pnameFieldName)
          Constructs an extent for the JORM class, in the form of a QueryLeaf.
ClassExtent(java.lang.Class jormClass, java.lang.String _name, java.lang.String pnameFieldName, boolean classPNameOnly)
          Constructs an extent for the JORM class, in the form of a QueryLeaf.
 
Method Summary
 QueryTreeField addField(TypedElement te)
          It adds a new Field into the tuple structure.
 java.lang.String getJormName()
           
 MetaObject getMetaObject()
           
 
Methods inherited from class org.objectweb.medor.query.jorm.lib.BasicJormExtent
clone, contains, contains, getDataStore, getDistinct, getField, getField, getFieldName, getFieldRank, getFields, getIdentifierField, getName, getOrderBy, getPMapper, getPNameFieldName, getProjectName, getSize, getTupleStructure, iterateFields, setDataStore, setDistinct, setOrderBy, setPMapper, setProjectName, setWithSubClasses, withSubClasses
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassExtent

public ClassExtent(java.lang.Class jormClass,
                   java.lang.String _name,
                   java.lang.String pnameFieldName,
                   boolean classPNameOnly)
            throws MedorException
Constructs an extent for the JORM class, in the form of a QueryLeaf. Two options are possible, depending on the value of the classPNameOnly parameter:
  1. either all attributes of the JORM class are present in the QueryLeaf
  2. or only the PName attribute is present in the QueryLeaf

Parameters:
jormClass - is the JORM full class name.
_name - is the name of the node (null value => empty string)
classPNameOnly - indicates whether the extent should contain only the PName for the class (if true) or all attributes for that class (if false).

ClassExtent

public ClassExtent(java.lang.Class jormClass,
                   java.lang.String _name,
                   java.lang.String[] fieldNames,
                   boolean addPName,
                   java.lang.String pnameFieldName)
            throws MedorException
Constructs an extent for the JORM class, in the form of a QueryLeaf. The field names for those fields which are part of the extent are passed as a parameter. The fact that the PName is part of the extent is optional.

Parameters:
jormClass - is the JORM full class name.
_name - is the name of the node (null value => empty string)
fieldNames - is an array of JORM field names which should be present in the extent
addPName - is a boolean which is true if the PName should be part of the extent, false otherwise.
Throws:
MedorException - if one of the requested fieldNames does not correspond to a field of the JORM class.
Method Detail

addField

public QueryTreeField addField(TypedElement te)
                        throws MedorException
It adds a new Field into the tuple structure.

Parameters:
te - is the jorm Meta object TypedElement which is the source of the field pname or the gen class pname.
Throws:
MedorException

getMetaObject

public MetaObject getMetaObject()

getJormName

public java.lang.String getJormName()
Specified by:
getJormName in interface JormExtent
Specified by:
getJormName in class BasicJormExtent