public class AnnotationSimpleRestriction extends AnnotationRestriction
annotation operator value
.Annotations
AnnotationRestriction.Options
Modifier and Type | Field and Description |
---|---|
private Operator |
operator |
private java.util.List<ParameterExpression> |
parameters |
private java.lang.Object |
value |
private java.util.List<java.lang.Object> |
values |
alias, annotationTypeId, options, valueType
Constructor and Description |
---|
AnnotationSimpleRestriction(java.lang.String alias,
AnnotationType annotationType,
Operator operator,
java.lang.Object value,
AnnotationRestriction.Options options)
Create a new annotation restriction using a simple expression:
annotation operator value . |
AnnotationSimpleRestriction(java.lang.String alias,
AnnotationType annotationType,
Operator operator,
java.lang.Object value,
boolean includeInheriting)
Deprecated.
|
AnnotationSimpleRestriction(java.lang.String alias,
AnnotationType annotationType,
Operator operator,
java.lang.Object value,
boolean includePrimary,
boolean includeInherited)
Deprecated.
|
AnnotationSimpleRestriction(java.lang.String alias,
int annotationTypeId,
Type valueType,
Operator operator,
java.util.List<java.lang.Object> values,
boolean includeInheriting)
Deprecated.
In 3.5; Use
AnnotationSimpleRestriction(String, int, Type, Operator, List, boolean, boolean) instead |
AnnotationSimpleRestriction(java.lang.String alias,
int annotationTypeId,
Type valueType,
Operator operator,
java.util.List<java.lang.Object> values,
boolean includePrimary,
boolean includeInherited)
Deprecated.
|
AnnotationSimpleRestriction(java.lang.String alias,
int annotationTypeId,
Type valueType,
Operator operator,
java.lang.Object value,
boolean includeInheriting)
Deprecated.
|
AnnotationSimpleRestriction(java.lang.String alias,
int annotationTypeId,
Type valueType,
Operator operator,
java.lang.Object value,
boolean includePrimary,
boolean includeInherited)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
This restriction is equal to another AnnotationSimpleRestriction if they
have the same annotation type, operator, list of values 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(org.hibernate.query.NativeQuery<?> query)
Set the value for all parameters defined in the SQL fragment
returned by
AnnotationRestriction.getRestrictionSql(Query, DbControl) . |
getChildren, maybeEquals, notAmongSelected, toQl
private final Operator operator
private final java.lang.Object value
private final java.util.List<java.lang.Object> values
private java.util.List<ParameterExpression> parameters
@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, AnnotationType annotationType, Operator operator, java.lang.Object value, boolean includeInheriting) throws InvalidDataException
AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, boolean, boolean)
insteadInvalidDataException
@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, AnnotationType annotationType, Operator operator, java.lang.Object value, boolean includePrimary, boolean includeInherited) throws InvalidDataException
AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)
insteadInvalidDataException
public AnnotationSimpleRestriction(java.lang.String alias, AnnotationType annotationType, Operator operator, java.lang.Object value, AnnotationRestriction.Options options) throws InvalidDataException
annotation operator value
.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 queryoperator
- The operator, it must be one of the expression
operators, EQ, NEQ, etc., not a boolean operator, AND, OR, etc.value
- The value to use in the query, it must be of the
correct value type for the annotation as defined by the
AnnotationType.getValueType()
propertyoptions
- Options that specify which annotations to consider when searchingInvalidDataException
- If any of the parameters are null
or not follow the rules above.@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, int annotationTypeId, Type valueType, Operator operator, java.lang.Object value, boolean includeInheriting) throws InvalidDataException
AnnotationSimpleRestriction(String, int, Type, Operator, Object, boolean, boolean)
insteadInvalidDataException
@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, int annotationTypeId, Type valueType, Operator operator, java.lang.Object value, boolean includePrimary, boolean includeInherited) throws InvalidDataException
AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)
insteadInvalidDataException
@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, int annotationTypeId, Type valueType, Operator operator, java.util.List<java.lang.Object> values, boolean includeInheriting) throws InvalidDataException
AnnotationSimpleRestriction(String, int, Type, Operator, List, boolean, boolean)
insteadInvalidDataException
@Deprecated public AnnotationSimpleRestriction(java.lang.String alias, int annotationTypeId, Type valueType, Operator operator, java.util.List<java.lang.Object> values, boolean includePrimary, boolean includeInherited) throws InvalidDataException
AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)
insteadInvalidDataException
java.lang.String getRestrictionSql(Query query, DbControl dc) throws BaseException
AnnotationRestriction
v.value = :theValueThe
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(NativeQuery)
void setRestrictionParameters(org.hibernate.query.NativeQuery<?> 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