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

java.lang.Object
  extended byBasicCloneable
      extended byorg.objectweb.medor.lib.BasicTupleStructure
          extended byorg.objectweb.medor.query.jorm.lib.BasicJormExtent
All Implemented Interfaces:
Cloneable, java.lang.Cloneable, JormExtent, QueryLeaf, QueryTree, TupleStructure
Direct Known 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
See Also:
Serialized Form

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  java.lang.String name
          Node name
protected  java.lang.String pnFieldName
          Name of the field which is the PName of the extent
protected  java.lang.String projectName
           
 
Fields inherited from class org.objectweb.medor.lib.BasicTupleStructure
fields, logger, name2field
 
Constructor Summary
BasicJormExtent()
           
BasicJormExtent(java.lang.String _name, java.lang.String pnFieldName)
           
 
Method Summary
 java.lang.Object clone(java.lang.Object clone, java.util.Map obj2clone)
           
 DataStore getDataStore()
          Methods inherited from QueryLeaf
 boolean getDistinct()
          Tests whether the results should be distinct or not.
 java.lang.String getFieldName(java.lang.String nodeName, java.lang.String fieldName)
           
 JormField getIdentifierField()
           
abstract  java.lang.String getJormName()
           
 java.lang.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()
           
 java.lang.String getPNameFieldName()
           
 java.lang.String getProjectName()
           
 TupleStructure getTupleStructure()
          Methods inherited from QueryTree
 java.util.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, java.lang.String projectName)
           
 void setProjectName(java.lang.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
contains, contains, getField, getField, getFieldRank, getFields, getSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.medor.query.jorm.api.JormExtent
getMetaObject
 
Methods inherited from interface org.objectweb.medor.api.TupleStructure
contains, contains, getField, getField, getFieldRank, getFields, getSize
 
Methods inherited from interface org.objectweb.medor.api.Cloneable
clone
 

Field Detail

name

protected java.lang.String name
Node name


pnFieldName

protected java.lang.String pnFieldName
Name of the field which is the PName of the extent


identifier

protected PNameField identifier

myStore

protected DataStore myStore
The datastore of the extent


mapper

protected PMapper mapper
The mapper of the extent.


projectName

protected java.lang.String projectName

includeSubclasses

protected boolean includeSubclasses
Are objects of subclasses included.

Constructor Detail

BasicJormExtent

public BasicJormExtent()

BasicJormExtent

public BasicJormExtent(java.lang.String _name,
                       java.lang.String pnFieldName)
Method Detail

clone

public java.lang.Object clone(java.lang.Object clone,
                              java.util.Map obj2clone)
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class BasicTupleStructure
Throws:
java.lang.CloneNotSupportedException

iterateFields

public java.util.Iterator iterateFields()

getFieldName

public java.lang.String getFieldName(java.lang.String nodeName,
                                     java.lang.String fieldName)

getPMapper

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

setPMapper

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

getProjectName

public java.lang.String getProjectName()
Specified by:
getProjectName in interface JormExtent

setProjectName

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

setDataStore

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

getPNameFieldName

public java.lang.String getPNameFieldName()
Specified by:
getPNameFieldName in interface JormExtent

getJormName

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

getIdentifierField

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

withSubClasses

public boolean withSubClasses()
Description copied from interface: JormExtent
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.

setWithSubClasses

public void setWithSubClasses(boolean incSubClasses)
Description copied from interface: JormExtent
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:
incSubClasses - is true if objects from subclasses are to be included, false if only strict instances of the corresponding class should be included.

getName

public java.lang.String getName()
Description copied from interface: QueryTree
It returns the name of the query tree.

Specified by:
getName in interface QueryTree

getTupleStructure

public TupleStructure getTupleStructure()
Methods inherited from QueryTree

Specified by:
getTupleStructure in interface QueryTree

getDataStore

public DataStore getDataStore()
Methods inherited from QueryLeaf

Specified by:
getDataStore in interface QueryLeaf

setDistinct

public void setDistinct(boolean d)
                 throws MedorException
Description copied from interface: QueryTree
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:
d - is true if duplicates should be eliminated, false otherwise.
Throws:
MedorException - if the distinct operation is not supported.

getDistinct

public boolean getDistinct()
Description copied from interface: QueryTree
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.

setOrderBy

public void setOrderBy(OrderField[] orderfields)
                throws MedorException
Description copied from interface: QueryTree
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:
orderfields - the array of OrderFields indicating the ordering in which the result should be returned.
Throws:
MedorException - if ordering is not supported.

getOrderBy

public OrderField[] getOrderBy()
Description copied from interface: QueryTree
Returns the array of OrderFields indicating how the result should be ordered.

Specified by:
getOrderBy in interface QueryTree
Returns:
the array of OrderFields.