public class HasAnnotationRestriction extends AnnotationRestriction
Annotations
Modifier and Type | Field and Description |
---|---|
private boolean |
hasBeenAnnotatated |
alias, annotationTypeId, includeInheriting, includePrimary, valueType
Constructor and Description |
---|
HasAnnotationRestriction(String alias,
AnnotationType annotationType,
boolean hasBeenAnnotatated,
boolean includeInheriting)
Deprecated.
In 3.5; Use
HasAnnotationRestriction(String, AnnotationType, boolean, boolean, boolean) instead |
HasAnnotationRestriction(String alias,
AnnotationType annotationType,
boolean hasBeenAnnotatated,
boolean includePrimary,
boolean includeInheriting)
Create a new restriction that checks if an item has been annotatated
or not.
|
HasAnnotationRestriction(String alias,
int annotationTypeId,
boolean hasBeenAnnotatated,
boolean includeInheriting)
Deprecated.
In 3.5; Use
HasAnnotationRestriction(String, int, boolean, boolean, boolean) instead |
HasAnnotationRestriction(String alias,
int annotationTypeId,
boolean hasBeenAnnotatated,
boolean includePrimary,
boolean includeInheriting) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other)
This restriction is equal to another HasAnnotationRestriction if they
have the same annotation type, inheritance setting and annotation check.
|
(package private) String |
getRestrictionSql(Query query,
DbControl dc)
Get an SQL fragment that includes the actual restriction.
|
int |
hashCode() |
(package private) boolean |
notAmongSelected()
If the main restriction should match items that had annotations
among the selected annotation sets, or not.
|
(package private) void |
setRestrictionParameters(SQLQuery query)
Set the value for all parameters defined in the SQL fragment
returned by
AnnotationRestriction.getRestrictionSql(Query, DbControl) . |
getChildren, maybeEquals, toQl
@Deprecated public HasAnnotationRestriction(String alias, AnnotationType annotationType, boolean hasBeenAnnotatated, boolean includeInheriting)
HasAnnotationRestriction(String, AnnotationType, boolean, boolean, boolean)
instead@Deprecated public HasAnnotationRestriction(String alias, int annotationTypeId, boolean hasBeenAnnotatated, boolean includeInheriting)
HasAnnotationRestriction(String, int, boolean, boolean, boolean)
insteadpublic HasAnnotationRestriction(String alias, AnnotationType annotationType, boolean hasBeenAnnotatated, boolean includePrimary, boolean includeInheriting)
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 queryhasBeenAnnotatated
- TRUE to look for items that has been annotated with the given
annotation type, FALSE to look for items that hasn'tincludePrimary
- If items with this annotation as a primary annotation
should be returned by the query or notincludeInheriting
- If items inherting the annotation should be returned
by the query or notpublic HasAnnotationRestriction(String alias, int annotationTypeId, boolean hasBeenAnnotatated, boolean includePrimary, boolean includeInheriting)
HasAnnotationRestriction(String, AnnotationType, boolean, boolean, boolean)
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 databaseboolean notAmongSelected()
AnnotationRestriction
notAmongSelected
in class AnnotationRestriction
public boolean equals(Object other)
public int hashCode()
hashCode
in class AnnotationRestriction