|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.AnnotationRestriction net.sf.basedb.core.AnnotationInRestriction
public class AnnotationInRestriction
Restricts a query using annotation values that exists in a set of given values.
Annotations
Field Summary | |
---|---|
private List<?> |
values
|
Fields inherited from class net.sf.basedb.core.AnnotationRestriction |
---|
alias, annotationTypeId, includeInheriting, valueType |
Constructor Summary | |
---|---|
AnnotationInRestriction(AnnotationType annotationType,
boolean includeInheriting,
Object... values)
Deprecated. Use AnnotationInRestriction(String, AnnotationType, boolean, Object[])
instead with alias=null |
|
AnnotationInRestriction(String alias,
AnnotationType annotationType,
boolean includeInheriting,
Object... values)
Create a new annotation restriction. |
Method Summary | |
---|---|
boolean |
equals(Object other)
This restriction is equal to another AnnotationInRestriction if they have the same annotation type, list of values and inheritance setting. |
(package private) String |
getRestrictionSql(Query query,
DbControl dc)
Get an SQL fragment that includes the actual restriction. |
int |
hashCode()
|
(package private) void |
setRestrictionParameters(org.hibernate.SQLQuery query)
Set the value for all parameters defined in the SQL fragment returned by AnnotationRestriction.getRestrictionSql(Query, DbControl) . |
Methods inherited from class net.sf.basedb.core.AnnotationRestriction |
---|
getChildren, maybeEquals, notAmongSelected, toQl |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final List<?> values
Constructor Detail |
---|
public AnnotationInRestriction(AnnotationType annotationType, boolean includeInheriting, Object... values) throws InvalidDataException
AnnotationInRestriction(String, AnnotationType, boolean, Object[])
instead with alias=null
InvalidDataException
public AnnotationInRestriction(String alias, AnnotationType annotationType, boolean includeInheriting, Object... values) throws InvalidDataException
alias
- The alias to use in the restriction.annotationType
- The annotation type to use in the queryincludeInheriting
- If items inherting the annotation should be returned
by the query or notvalues
- An array of values, each value must be of the
correct value type for the annotation as defined by the
AnnotationType.getValueType()
property
InvalidDataException
- If any of the parameters are null
or the array is empty or not follow the rules above.Method Detail |
---|
String getRestrictionSql(Query query, DbControl dc) throws BaseException
AnnotationRestriction
v.value = :theValue ThesetRestrictionParameters
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 execute
BaseException
AnnotationRestriction.setRestrictionParameters(SQLQuery)
void setRestrictionParameters(org.hibernate.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(Object other)
equals
in class Object
public int hashCode()
hashCode
in class AnnotationRestriction
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |