public class AnnotationBetweenRestriction extends AnnotationRestriction
Annotations
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
highValue |
private java.lang.Object |
lowValue |
alias, annotationTypeId, includeInheriting, valueType
Constructor and Description |
---|
AnnotationBetweenRestriction(java.lang.String alias,
AnnotationType annotationType,
java.lang.Object lowValue,
java.lang.Object highValue,
boolean includeInheriting)
Create a new annotation restriction.
|
AnnotationBetweenRestriction(java.lang.String alias,
int annotationTypeId,
Type valueType,
java.lang.Object lowValue,
java.lang.Object highValue,
boolean includeInheriting)
Create a new annotation restriction.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
This restriction is equal to another AnnotationBetweenRestriction if they
have the same annotation type, upper and lower bound and inheritance setting.
|
(package private) java.lang.String |
getRestrictionSql(Query query,
DbControl dc)
Get an SQL fragment that includes the actual restriction.
|
int |
hashCode() |
(package private) void |
setRestrictionParameters(SQLQuery query)
Set the value for all parameters defined in the SQL fragment
returned by
AnnotationRestriction.getRestrictionSql(Query, DbControl) . |
java.lang.String |
toString() |
getChildren, maybeEquals, notAmongSelected, toQl
private final java.lang.Object lowValue
private final java.lang.Object highValue
public AnnotationBetweenRestriction(java.lang.String alias, AnnotationType annotationType, java.lang.Object lowValue, java.lang.Object highValue, boolean includeInheriting) throws InvalidDataException
alias
- The alias of a joined item where the annotations are
located or null to use the root entity of the queryannotationType
- The annotation type to use in the querylowValue
- The low value to use in the query, it must be of the
correct value type for the annotation as defined by the
AnnotationType.getValueType()
propertyhighValue
- The high value to use in the query, it must be of the
correct value type for the annotation as defined by the
AnnotationType.getValueType()
propertyincludeInheriting
- If items inherting the annotation should be returned
by the query or notInvalidDataException
- If any of the parameters are null
or not follow the rules above.public AnnotationBetweenRestriction(java.lang.String alias, int annotationTypeId, Type valueType, java.lang.Object lowValue, java.lang.Object highValue, boolean includeInheriting) throws InvalidDataException
alias
- The alias of a joined item where the annotations are
located or null to use the root entity of the queryannotationTypeId
- The id of the annotation type to use in the queryvalueType
- The type of values for annotationslowValue
- The low value to use in the query, it must be of the
correct value type for the annotation as defined by the
valueType propertyhighValue
- The high value to use in the query, it must be of the
correct value type for the annotation as defined by the
valueType propertyincludeInheriting
- If items inherting the annotation should be returned
by the query or notInvalidDataException
- If any of the parameters are null
or not follow the rules above.java.lang.String getRestrictionSql(Query query, DbControl dc) throws BaseException
AnnotationRestriction
v.value = :theValue
The setRestrictionParameters
method is called to
allow the subclass to set the value of the parameters specified
in the SQL fragment.
getRestrictionSql
in class AnnotationRestriction
query
- The query object we are about to executeBaseException
AnnotationRestriction.setRestrictionParameters(SQLQuery)
void setRestrictionParameters(SQLQuery query)
AnnotationRestriction
AnnotationRestriction.getRestrictionSql(Query, DbControl)
.setRestrictionParameters
in class AnnotationRestriction
query
- The Hibernate SQLQuery
object which is
used to query the databasepublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class AnnotationRestriction
public java.lang.String toString()
toString
in class java.lang.Object