it.eng.qbe.query
Class Query

java.lang.Object
  extended by it.eng.qbe.query.Query
All Implemented Interfaces:
IQuery

public class Query
extends java.lang.Object
implements IQuery

The Class Query.


Constructor Summary
Query()
          Instantiates a new query.
 
Method Summary
 CalculatedField addCalculatedField(java.lang.String fieldId, java.lang.String fieldNameInQuery, java.lang.String classNameInQuery, Formula formula, IHibernateDataSource dataSource)
          Adds the calculated field.
 void addEntityClass(EntityClass ec)
          Adds the entity class.
 IGroupByField addGroupByField(java.lang.String fieldName)
          Adds the group by field.
 IOrderByField addOrderByField(java.lang.String fieldName)
          Adds the order by field.
 ISelectField addSelectField(java.lang.String className, java.lang.String fieldName, java.lang.String fieldLabel, java.lang.String fieldHibType, java.lang.String fieldHibScale, java.lang.String fieldHibPrec)
          Adds the select field.
 IWhereField addWhereField(java.lang.String fieldName, java.lang.String type)
          Adds the where field.
 boolean areAllEntitiesJoined()
          Are all entities joined.
 boolean areEntitiyJoined(EntityClass entity)
          Are entitiy joined.
 boolean containEntityClass(EntityClass parameEc)
          Contain entity class.
 boolean containsDuplicatedAliases()
          Contains duplicated aliases.
 void deleteCalculatedField(java.lang.String fieldId)
          Delete calculated field.
 void deleteGroupByClause()
          Delete group by clause.
 void deleteGroupByField(java.lang.String fieldId)
          Delete group by field.
 void deleteOrderByClause()
          Delete order by clause.
 void deleteOrderByField(java.lang.String fieldId)
          Delete order by field.
 void deleteSelectClause()
          Delete select clause.
 void deleteSelectField(java.lang.String fieldId)
          Delete select field.
 void deleteWhereClause()
          Delete where clause.
 void deleteWhereField(java.lang.String fieldId)
          Delete where field.
 void deselectSubquery()
          Deselect subquery.
 java.lang.Integer findPositionOf(java.lang.String completeName)
          Find position of.
 java.util.Iterator getCalculatedFieldsIterator()
          Gets the calculated fields iterator.
 IQuery getCopy()
          Gets the copy.
 boolean getDistinct()
          Gets the distinct.
 java.lang.String[] getDuplicatedAliases()
          Gets the duplicated aliases.
 java.util.Iterator getEntityClassesIterator()
          Gets the entity classes iterator.
 java.lang.String getErrMsg()
          Gets the err msg.
 java.util.Iterator getGroupByFieldsIterator()
          Gets the group by fields iterator.
 java.util.Map getMapFieldIdSubQUeryId()
          Gets the map field id sub q uery id.
 java.util.Iterator getOrderByFieldsIterator()
          Gets the order by fields iterator.
 java.lang.String getQueryId()
          Gets the query id.
 java.util.Iterator getSelectFieldsIterator()
          Gets the select fields iterator.
 IQuery getSubquery(java.lang.String fieldId)
          Gets the subquery.
 java.lang.String getSubqueryErrMsg(java.lang.String fieldId)
          Gets the subquery err msg.
 java.lang.String getSubqueryField()
          Gets the subquery field.
 java.lang.String getSubqueryFieldId()
          Gets the subquery field id.
 java.lang.String getSubQueryIdForSubQueryOnField(java.lang.String fieldId)
          Gets the sub query id for sub query on field.
 java.util.Iterator getWhereFieldsIterator()
          Gets the where fields iterator.
 boolean isEmpty()
          Checks if is empty.
 boolean isSelectedSubqueryValid()
          Checks if is selected subquery valid.
 boolean isSubqueryDefined(java.lang.String fieldId)
          Checks if is subquery defined.
 boolean isSubqueryModeActive()
          Checks if is subquery mode active.
 boolean isSubqueryValid(IQuery subquery)
          Checks if is subquery valid.
 boolean isSubqueryValid(java.lang.String fieldId)
          Checks if is subquery valid.
 void moveDownGroupByField(java.lang.String fieldId)
          Move down group by field.
 void moveDownOrderByField(java.lang.String fieldId)
          Move down order by field.
 void moveDownSelectField(java.lang.String fieldId)
          Move down select field.
 void moveDownWhereField(java.lang.String fieldId)
          Move down where field.
 void moveUpGroupByField(java.lang.String fieldId)
          Move up group by field.
 void moveUpOrderByField(java.lang.String fieldId)
          Move up order by field.
 void moveUpSelectField(java.lang.String fieldId)
          Move up select field.
 void moveUpWhereField(java.lang.String fieldId)
          Move up where field.
 void purgeNotReferredEntityClasses()
          Purge not referred entity classes.
 void purgeNotReferredEntityClasses(java.lang.String prefix)
          Purge not referred entity classes.
 void saveSelectedSubquery()
          Save selected subquery.
 void selectSubquery(java.lang.String fieldId)
          Select subquery.
 void setDistinct(boolean distinct)
          Sets the distinct.
 void setErrMsg(java.lang.String errMsg)
          Sets the err msg.
 void setMapFieldIdSubQUeryId(java.util.Map mapFieldIdSubQUeryId)
          Sets the map field id sub q uery id.
 void setQueryId(java.lang.String queryId)
          Sets the query id.
 void switchAscendingOrderPopertyValue(java.lang.String fieldId)
          Switch ascending order poperty value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Query

public Query()
Instantiates a new query.

Method Detail

getQueryId

public java.lang.String getQueryId()
Description copied from interface: IQuery
Gets the query id.

Specified by:
getQueryId in interface IQuery
Returns:
the query id

setQueryId

public void setQueryId(java.lang.String queryId)
Description copied from interface: IQuery
Sets the query id.

Specified by:
setQueryId in interface IQuery
Parameters:
queryId - the new query id

isEmpty

public boolean isEmpty()
Description copied from interface: IQuery
Checks if is empty.

Specified by:
isEmpty in interface IQuery
Returns:
true, if is empty

deleteSelectClause

public void deleteSelectClause()
Description copied from interface: IQuery
Delete select clause.

Specified by:
deleteSelectClause in interface IQuery

deleteSelectField

public void deleteSelectField(java.lang.String fieldId)
Description copied from interface: IQuery
Delete select field.

Specified by:
deleteSelectField in interface IQuery
Parameters:
fieldId - the field id

deleteCalculatedField

public void deleteCalculatedField(java.lang.String fieldId)
Description copied from interface: IQuery
Delete calculated field.

Specified by:
deleteCalculatedField in interface IQuery
Parameters:
fieldId - the field id

getSelectFieldsIterator

public java.util.Iterator getSelectFieldsIterator()
Description copied from interface: IQuery
Gets the select fields iterator.

Specified by:
getSelectFieldsIterator in interface IQuery
Returns:
the select fields iterator

getCalculatedFieldsIterator

public java.util.Iterator getCalculatedFieldsIterator()
Description copied from interface: IQuery
Gets the calculated fields iterator.

Specified by:
getCalculatedFieldsIterator in interface IQuery
Returns:
the calculated fields iterator

addSelectField

public ISelectField addSelectField(java.lang.String className,
                                   java.lang.String fieldName,
                                   java.lang.String fieldLabel,
                                   java.lang.String fieldHibType,
                                   java.lang.String fieldHibScale,
                                   java.lang.String fieldHibPrec)
Description copied from interface: IQuery
Adds the select field.

Specified by:
addSelectField in interface IQuery
Parameters:
className - the class name
fieldName - the field name
fieldLabel - the field label
fieldHibType - the field hib type
fieldHibScale - the field hib scale
fieldHibPrec - the field hib prec
Returns:
the i select field

addCalculatedField

public CalculatedField addCalculatedField(java.lang.String fieldId,
                                          java.lang.String fieldNameInQuery,
                                          java.lang.String classNameInQuery,
                                          Formula formula,
                                          IHibernateDataSource dataSource)
Description copied from interface: IQuery
Adds the calculated field.

Specified by:
addCalculatedField in interface IQuery
Parameters:
fieldId - the field id
fieldNameInQuery - the field name in query
classNameInQuery - the class name in query
formula - the formula
dataSource - the data source
Returns:
the calculated field

moveDownSelectField

public void moveDownSelectField(java.lang.String fieldId)
Description copied from interface: IQuery
Move down select field.

Specified by:
moveDownSelectField in interface IQuery
Parameters:
fieldId - the field id

moveUpSelectField

public void moveUpSelectField(java.lang.String fieldId)
Description copied from interface: IQuery
Move up select field.

Specified by:
moveUpSelectField in interface IQuery
Parameters:
fieldId - the field id

setDistinct

public void setDistinct(boolean distinct)
Description copied from interface: IQuery
Sets the distinct.

Specified by:
setDistinct in interface IQuery
Parameters:
distinct - the new distinct

getDistinct

public boolean getDistinct()
Description copied from interface: IQuery
Gets the distinct.

Specified by:
getDistinct in interface IQuery
Returns:
the distinct

deleteWhereClause

public void deleteWhereClause()
Description copied from interface: IQuery
Delete where clause.

Specified by:
deleteWhereClause in interface IQuery

deleteWhereField

public void deleteWhereField(java.lang.String fieldId)
Description copied from interface: IQuery
Delete where field.

Specified by:
deleteWhereField in interface IQuery
Parameters:
fieldId - the field id

addWhereField

public IWhereField addWhereField(java.lang.String fieldName,
                                 java.lang.String type)
Description copied from interface: IQuery
Adds the where field.

Specified by:
addWhereField in interface IQuery
Parameters:
fieldName - the field name
type - the type
Returns:
the i where field

getWhereFieldsIterator

public java.util.Iterator getWhereFieldsIterator()
Description copied from interface: IQuery
Gets the where fields iterator.

Specified by:
getWhereFieldsIterator in interface IQuery
Returns:
the where fields iterator

moveDownWhereField

public void moveDownWhereField(java.lang.String fieldId)
Description copied from interface: IQuery
Move down where field.

Specified by:
moveDownWhereField in interface IQuery
Parameters:
fieldId - the field id

moveUpWhereField

public void moveUpWhereField(java.lang.String fieldId)
Description copied from interface: IQuery
Move up where field.

Specified by:
moveUpWhereField in interface IQuery
Parameters:
fieldId - the field id

deleteOrderByClause

public void deleteOrderByClause()
Description copied from interface: IQuery
Delete order by clause.

Specified by:
deleteOrderByClause in interface IQuery

deleteOrderByField

public void deleteOrderByField(java.lang.String fieldId)
Description copied from interface: IQuery
Delete order by field.

Specified by:
deleteOrderByField in interface IQuery
Parameters:
fieldId - the field id

addOrderByField

public IOrderByField addOrderByField(java.lang.String fieldName)
Description copied from interface: IQuery
Adds the order by field.

Specified by:
addOrderByField in interface IQuery
Parameters:
fieldName - the field name
Returns:
the i order by field

getOrderByFieldsIterator

public java.util.Iterator getOrderByFieldsIterator()
Description copied from interface: IQuery
Gets the order by fields iterator.

Specified by:
getOrderByFieldsIterator in interface IQuery
Returns:
the order by fields iterator

moveDownOrderByField

public void moveDownOrderByField(java.lang.String fieldId)
Description copied from interface: IQuery
Move down order by field.

Specified by:
moveDownOrderByField in interface IQuery
Parameters:
fieldId - the field id

moveUpOrderByField

public void moveUpOrderByField(java.lang.String fieldId)
Description copied from interface: IQuery
Move up order by field.

Specified by:
moveUpOrderByField in interface IQuery
Parameters:
fieldId - the field id

switchAscendingOrderPopertyValue

public void switchAscendingOrderPopertyValue(java.lang.String fieldId)
Description copied from interface: IQuery
Switch ascending order poperty value.

Specified by:
switchAscendingOrderPopertyValue in interface IQuery
Parameters:
fieldId - the field id

deleteGroupByClause

public void deleteGroupByClause()
Description copied from interface: IQuery
Delete group by clause.

Specified by:
deleteGroupByClause in interface IQuery

deleteGroupByField

public void deleteGroupByField(java.lang.String fieldId)
Description copied from interface: IQuery
Delete group by field.

Specified by:
deleteGroupByField in interface IQuery
Parameters:
fieldId - the field id

addGroupByField

public IGroupByField addGroupByField(java.lang.String fieldName)
Description copied from interface: IQuery
Adds the group by field.

Specified by:
addGroupByField in interface IQuery
Parameters:
fieldName - the field name
Returns:
the i group by field

getGroupByFieldsIterator

public java.util.Iterator getGroupByFieldsIterator()
Description copied from interface: IQuery
Gets the group by fields iterator.

Specified by:
getGroupByFieldsIterator in interface IQuery
Returns:
the group by fields iterator

moveDownGroupByField

public void moveDownGroupByField(java.lang.String fieldId)
Description copied from interface: IQuery
Move down group by field.

Specified by:
moveDownGroupByField in interface IQuery
Parameters:
fieldId - the field id

moveUpGroupByField

public void moveUpGroupByField(java.lang.String fieldId)
Description copied from interface: IQuery
Move up group by field.

Specified by:
moveUpGroupByField in interface IQuery
Parameters:
fieldId - the field id

getEntityClassesIterator

public java.util.Iterator getEntityClassesIterator()
Description copied from interface: IQuery
Gets the entity classes iterator.

Specified by:
getEntityClassesIterator in interface IQuery
Returns:
the entity classes iterator

addEntityClass

public void addEntityClass(EntityClass ec)
Description copied from interface: IQuery
Adds the entity class.

Specified by:
addEntityClass in interface IQuery
Parameters:
ec - the ec

containEntityClass

public boolean containEntityClass(EntityClass parameEc)
Description copied from interface: IQuery
Contain entity class.

Specified by:
containEntityClass in interface IQuery
Parameters:
parameEc - the ec
Returns:
true, if successful

purgeNotReferredEntityClasses

public void purgeNotReferredEntityClasses()
Description copied from interface: IQuery
Purge not referred entity classes.

Specified by:
purgeNotReferredEntityClasses in interface IQuery

purgeNotReferredEntityClasses

public void purgeNotReferredEntityClasses(java.lang.String prefix)
Description copied from interface: IQuery
Purge not referred entity classes.

Specified by:
purgeNotReferredEntityClasses in interface IQuery
Parameters:
prefix - the prefix

areAllEntitiesJoined

public boolean areAllEntitiesJoined()
Description copied from interface: IQuery
Are all entities joined.

Specified by:
areAllEntitiesJoined in interface IQuery
Returns:
true, if successful

areEntitiyJoined

public boolean areEntitiyJoined(EntityClass entity)
Are entitiy joined.

Parameters:
entity - the entity
Returns:
true, if successful

getDuplicatedAliases

public java.lang.String[] getDuplicatedAliases()
Description copied from interface: IQuery
Gets the duplicated aliases.

Specified by:
getDuplicatedAliases in interface IQuery
Returns:
the duplicated aliases

containsDuplicatedAliases

public boolean containsDuplicatedAliases()
Description copied from interface: IQuery
Contains duplicated aliases.

Specified by:
containsDuplicatedAliases in interface IQuery
Returns:
true, if successful

isSubqueryModeActive

public boolean isSubqueryModeActive()
Description copied from interface: IQuery
Checks if is subquery mode active.

Specified by:
isSubqueryModeActive in interface IQuery
Returns:
true, if is subquery mode active

getSubqueryField

public java.lang.String getSubqueryField()
Description copied from interface: IQuery
Gets the subquery field.

Specified by:
getSubqueryField in interface IQuery
Returns:
the subquery field

getSubqueryFieldId

public java.lang.String getSubqueryFieldId()
Description copied from interface: IQuery
Gets the subquery field id.

Specified by:
getSubqueryFieldId in interface IQuery
Returns:
the subquery field id

getSubquery

public IQuery getSubquery(java.lang.String fieldId)
Description copied from interface: IQuery
Gets the subquery.

Specified by:
getSubquery in interface IQuery
Parameters:
fieldId - the field id
Returns:
the subquery

isSubqueryDefined

public boolean isSubqueryDefined(java.lang.String fieldId)
Checks if is subquery defined.

Parameters:
fieldId - the field id
Returns:
true, if is subquery defined

selectSubquery

public void selectSubquery(java.lang.String fieldId)
Description copied from interface: IQuery
Select subquery.

Specified by:
selectSubquery in interface IQuery
Parameters:
fieldId - the field id

saveSelectedSubquery

public void saveSelectedSubquery()
Description copied from interface: IQuery
Save selected subquery.

Specified by:
saveSelectedSubquery in interface IQuery

deselectSubquery

public void deselectSubquery()
Description copied from interface: IQuery
Deselect subquery.

Specified by:
deselectSubquery in interface IQuery

getSubQueryIdForSubQueryOnField

public java.lang.String getSubQueryIdForSubQueryOnField(java.lang.String fieldId)
Description copied from interface: IQuery
Gets the sub query id for sub query on field.

Specified by:
getSubQueryIdForSubQueryOnField in interface IQuery
Parameters:
fieldId - the field id
Returns:
the sub query id for sub query on field

getErrMsg

public java.lang.String getErrMsg()
Description copied from interface: IQuery
Gets the err msg.

Specified by:
getErrMsg in interface IQuery
Returns:
the err msg

getSubqueryErrMsg

public java.lang.String getSubqueryErrMsg(java.lang.String fieldId)
Description copied from interface: IQuery
Gets the subquery err msg.

Specified by:
getSubqueryErrMsg in interface IQuery
Parameters:
fieldId - the field id
Returns:
the subquery err msg

setErrMsg

public void setErrMsg(java.lang.String errMsg)
Description copied from interface: IQuery
Sets the err msg.

Specified by:
setErrMsg in interface IQuery
Parameters:
errMsg - the new err msg

getMapFieldIdSubQUeryId

public java.util.Map getMapFieldIdSubQUeryId()
Gets the map field id sub q uery id.

Returns:
the map field id sub q uery id

setMapFieldIdSubQUeryId

public void setMapFieldIdSubQUeryId(java.util.Map mapFieldIdSubQUeryId)
Sets the map field id sub q uery id.

Parameters:
mapFieldIdSubQUeryId - the new map field id sub q uery id

getCopy

public IQuery getCopy()
Description copied from interface: IQuery
Gets the copy.

Specified by:
getCopy in interface IQuery
Returns:
the copy

isSubqueryValid

public boolean isSubqueryValid(IQuery subquery)
Description copied from interface: IQuery
Checks if is subquery valid.

Specified by:
isSubqueryValid in interface IQuery
Parameters:
subquery - the subquery
Returns:
true, if is subquery valid

isSelectedSubqueryValid

public boolean isSelectedSubqueryValid()
Description copied from interface: IQuery
Checks if is selected subquery valid.

Specified by:
isSelectedSubqueryValid in interface IQuery
Returns:
true, if is selected subquery valid

isSubqueryValid

public boolean isSubqueryValid(java.lang.String fieldId)
Checks if is subquery valid.

Parameters:
fieldId - the field id
Returns:
true, if is subquery valid

findPositionOf

public java.lang.Integer findPositionOf(java.lang.String completeName)
Description copied from interface: IQuery
Find position of.

Specified by:
findPositionOf in interface IQuery
Parameters:
completeName - the complete name
Returns:
the integer