|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.AnnotationRestriction
abstract class AnnotationRestriction
Base class for creating restrictions based on annotations.
Subclasses must implent the getRestrictionSql(Query, DbControl)
and setRestrictionParameters(SQLQuery)
method.
Annotations| Field Summary | |
|---|---|
(package private) String |
alias
|
(package private) int |
annotationTypeId
|
private static boolean |
debugSqlEnabled
So we don't always have to call logSql.debug() |
(package private) boolean |
includeInheriting
|
private static Logger |
logSql
Log all SQL statements. |
(package private) Type |
valueType
|
| Constructor Summary | |
|---|---|
AnnotationRestriction(String alias,
AnnotationType annotationType,
boolean includeInheriting)
Create a new annotation restriction for an annotation type. |
|
AnnotationRestriction(String alias,
int annotationTypeId,
Type valueType,
boolean includeInheriting)
Create a new annotation restriction given the id and value type of an annotation. |
|
| Method Summary | |
|---|---|
Collection<? extends QueryElement> |
getChildren()
Get the children of this query element or null if it has no children. |
(package private) abstract String |
getRestrictionSql(Query query,
DbControl dc)
Get an SQL fragment that includes the actual restriction. |
int |
hashCode()
|
protected Boolean |
maybeEquals(Object other)
Check as many things as possible to try to determine if the other object is equal to this object. |
(package private) boolean |
notAmongSelected()
If the main restriction should match items that had annotations among the selected annotation sets, or not. |
(package private) abstract void |
setRestrictionParameters(SQLQuery query)
Set the value for all parameters defined in the SQL fragment returned by getRestrictionSql(Query, DbControl). |
String |
toQl(Query query,
DbControl dc)
Create a query language string of the query element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Logger logSql
private static final boolean debugSqlEnabled
final Type valueType
final int annotationTypeId
final boolean includeInheriting
final String alias
| Constructor Detail |
|---|
AnnotationRestriction(String alias,
AnnotationType annotationType,
boolean includeInheriting)
throws InvalidDataException
annotationType - The annotation type to use in the query
InvalidDataException
AnnotationRestriction(String alias,
int annotationTypeId,
Type valueType,
boolean includeInheriting)
throws InvalidDataException
annotationTypeId - The id of the annotation typevalueType - The type of values for annotations
InvalidDataException| Method Detail |
|---|
public String toQl(Query query,
DbControl dc)
throws BaseException
QueryElementQuery.getQueryType() method to find out which query language is wanted
in case the element requires different syntax for different languages.
toQl in interface QueryElementquery - The query that is about to be executeddc - The DbControl object used to execute the query
BaseException - If there is any other errorpublic Collection<? extends QueryElement> getChildren()
QueryElementAddExpression has two children, the expression
beeing added.
getChildren in interface QueryElementprotected Boolean maybeEquals(Object other)
public int hashCode()
hashCode in class Object
abstract String getRestrictionSql(Query query,
DbControl dc)
throws BaseException
v.value = :theValue
The setRestrictionParameters method is called to
allow the subclass to set the value of the parameters specified
in the SQL fragment.
query - The query object we are about to execute
BaseExceptionsetRestrictionParameters(SQLQuery)abstract void setRestrictionParameters(SQLQuery query)
getRestrictionSql(Query, DbControl).
query - The Hibernate SQLQuery object which is
used to query the databaseboolean notAmongSelected()
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||