org.objectweb.medor.query.jorm.lib

Class BasicJormExtent

Implemented Interfaces:
Cloneable, Cloneable, JormExtent, QueryLeaf, QueryTree, TupleStructure
Known Direct Subclasses:
ClassExtent, GenClassExtent

public abstract class BasicJormExtent
extends BasicTupleStructure
implements JormExtent, QueryLeaf, TupleStructure

This class is the common implementation of the jorm leaves (ClassExtent, GenClassExtent).

Author:
S.Chassande-Barrioz

Field Summary

protected PNameField
identifier
protected boolean
includeSubclasses
Are objects of subclasses included.
protected PMapper
mapper
The mapper of the extent.
protected DataStore
myStore
The datastore of the extent
protected String
name
Node name
protected String
pnFieldName
Name of the field which is the PName of the extent
protected String
projectName

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

fields, logger, name2field

Constructor Summary

BasicJormExtent()
BasicJormExtent(String _name, String pnFieldName)

Method Summary

Object
clone(Object clone, Map obj2clone)
DataStore
getDataStore()
Methods inherited from QueryLeaf
boolean
getDistinct()
Tests whether the results should be distinct or not.
String
getFieldName(String nodeName, String fieldName)
JormField
getIdentifierField()
String
getJormName()
String
getName()
It returns the name of the query tree.
OrderField[]
getOrderBy()
Returns the array of OrderFields indicating how the result should be ordered.
PMapper
getPMapper()
String
getPNameFieldName()
String
getProjectName()
TupleStructure
getTupleStructure()
Methods inherited from QueryTree
Iterator
iterateFields()
void
setDataStore(DataStore ds)
void
setDistinct(boolean d)
Indicates whether evaluating the QueryTree should return unique results (duplicate elimination) or not.
void
setOrderBy(OrderField[] orderfields)
Sets the OrderBy array of OrderFields.
void
setPMapper(PMapper m, String projectName)
void
setProjectName(String projectName)
void
setWithSubClasses(boolean incSubClasses)
Indicates whether the current Extent should also contain objects from the subclasses.
boolean
withSubClasses()
Tells whether the current Extent should also contain objects from the subclasses.

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

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

Field Details

identifier

protected PNameField identifier


includeSubclasses

protected boolean includeSubclasses
Are objects of subclasses included.


mapper

protected PMapper mapper
The mapper of the extent.


myStore

protected DataStore myStore
The datastore of the extent


name

protected String name
Node name


pnFieldName

protected String pnFieldName
Name of the field which is the PName of the extent


projectName

protected String projectName

Constructor Details

BasicJormExtent

public BasicJormExtent()


BasicJormExtent

public BasicJormExtent(String _name,
                       String pnFieldName)

Method Details

clone

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


getDataStore

public DataStore getDataStore()
Methods inherited from QueryLeaf
Specified by:
getDataStore in interface QueryLeaf


getDistinct

public boolean getDistinct()
Tests whether the results should be distinct or not.
Specified by:
getDistinct in interface QueryTree

Returns:
true if there results should be distinct, false otherwise.


getFieldName

public String getFieldName(String nodeName,
                           String fieldName)


getIdentifierField

public JormField getIdentifierField()
Specified by:
getIdentifierField in interface JormExtent


getJormName

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


getName

public String getName()
It returns the name of the query tree.
Specified by:
getName in interface QueryTree


getOrderBy

public OrderField[] getOrderBy()
Returns the array of OrderFields indicating how the result should be ordered.
Specified by:
getOrderBy in interface QueryTree

Returns:
the array of OrderFields.


getPMapper

public PMapper getPMapper()
Specified by:
getPMapper in interface JormExtent


getPNameFieldName

public String getPNameFieldName()
Specified by:
getPNameFieldName in interface JormExtent


getProjectName

public String getProjectName()
Specified by:
getProjectName in interface JormExtent


getTupleStructure

public TupleStructure getTupleStructure()
Methods inherited from QueryTree
Specified by:
getTupleStructure in interface QueryTree


iterateFields

public Iterator iterateFields()


setDataStore

public void setDataStore(DataStore ds)
Specified by:
setDataStore in interface JormExtent


setDistinct

public void setDistinct(boolean d)
            throws MedorException
Indicates whether evaluating the QueryTree should return unique results (duplicate elimination) or not.

The default should be that duplicates are not eliminated (distinct is false).

Specified by:
setDistinct in interface QueryTree

Parameters:

Throws:
MedorException - if the distinct operation is not supported.


setOrderBy

public void setOrderBy(OrderField[] orderfields)
            throws MedorException
Sets the OrderBy array of OrderFields.

This array indicates the fields by which the results should be ordered.

Like for filters assigned to QueryNodes, the Fields used for ordering must belong to children of the current QueryTree.

A noticeable exception is the case of RdbExpQueryLeaves, where ordering fields are fields of the QueryLeaf itself.

Specified by:
setOrderBy in interface QueryTree

Parameters:

Throws:
MedorException - if ordering is not supported.


setPMapper

public void setPMapper(PMapper m,
                       String projectName)
Specified by:
setPMapper in interface JormExtent


setProjectName

public void setProjectName(String projectName)
Specified by:
setProjectName in interface JormExtent


setWithSubClasses

public void setWithSubClasses(boolean incSubClasses)
Indicates whether the current Extent should also contain objects from the subclasses.

The default is that only objects strictly in the current class are included, and not objects of the subclasses.

Specified by:
setWithSubClasses in interface JormExtent

Parameters:


withSubClasses

public boolean withSubClasses()
Tells whether the current Extent should also contain objects from the subclasses.

The default is that only objects strictly in the current class are included, and not objects of the subclasses.

Specified by:
withSubClasses in interface JormExtent

Returns:
true if objects from subclasses are to be included, false if only strict instances of the corresponding class should be included.