org.objectweb.medor.query.jorm.lib

Class ClassExtent

Implemented Interfaces:
Cloneable, 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

identifier, includeSubclasses, mapper, myStore, name, pnFieldName, projectName

Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure

fields, logger, name2field

Constructor Summary

ClassExtent()
ClassExtent(Class jormClass, String _name, String pnameFieldName, boolean classPNameOnly)
Constructs an extent for the JORM class, in the form of a QueryLeaf.
ClassExtent(Class jormClass, String _name, String[] fieldNames, boolean addPName, String pnameFieldName)
Constructs an extent for the JORM class, in the form of a QueryLeaf.
ClassExtent(String _name, String pnFieldName)

Method Summary

QueryTreeField
addField(String fieldName)
QueryTreeField
addField(TypedElement te)
It adds a new Field into the tuple structure.
Object
clone(Object clone, Map obj2clone)
String
getJormName()
MetaObject
getMetaObject()

Methods inherited from class org.objectweb.medor.query.jorm.lib.BasicJormExtent

clone, getDataStore, getDistinct, getFieldName, getIdentifierField, getJormName, getName, getOrderBy, getPMapper, getPNameFieldName, getProjectName, getTupleStructure, iterateFields, setDataStore, setDistinct, setOrderBy, setPMapper, setProjectName, setWithSubClasses, withSubClasses

Methods inherited from class org.objectweb.medor.lib.BasicTupleStructure

clone, contains, contains, getField, getField, getFieldRank, getFields, getSize

Constructor Details

ClassExtent

public ClassExtent()


ClassExtent

public ClassExtent(Class jormClass,
                   String _name,
                   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(Class jormClass,
                   String _name,
                   String[] fieldNames,
                   boolean addPName,
                   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.


ClassExtent

public ClassExtent(String _name,
                   String pnFieldName)

Method Details

addField

public QueryTreeField addField(String fieldName)
            throws MedorException


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.


clone

public Object clone(Object clone,
                    Map obj2clone)
            throws CloneNotSupportedException
Overrides:
clone in interface BasicJormExtent


getJormName

public String getJormName()
Specified by:
getJormName in interface JormExtent
Overrides:
getJormName in interface BasicJormExtent


getMetaObject

public MetaObject getMetaObject()
Specified by:
getMetaObject in interface JormExtent