2.17.2: 2011-06-17

net.sf.basedb.core.query
Class Annotations

java.lang.Object
  extended by net.sf.basedb.core.query.Annotations

public class Annotations
extends Object

A factory class to create restrictions based on annotation values.

Version:
2.0
Author:
Nicklas

Constructor Summary
Annotations()
           
 
Method Summary
static Restriction between(AnnotationType annotationType, Object lowValue, Object highValue, boolean includeInheriting)
          Deprecated. Use between(String, AnnotationType, Object, Object, boolean) instead with alias=null
static Restriction between(String alias, AnnotationType annotationType, Object lowValue, Object highValue, boolean includeInheriting)
          Create a restriction that searches for annotations between two given values on the root or a joined entity of a query.
static Restriction eq(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use eq(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction eq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations equal to a given value on the root or a joined entity of a query.
static Restriction gt(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use gt(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction gt(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations greater than a given value on the root or a joined entity of a query.
static Restriction gteq(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use gteq(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction gteq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations greater than or equal to a given value on the root or a joined entity of a query.
static Restriction in(AnnotationType annotationType, boolean includeInheriting, Object... values)
          Deprecated. Use in(String, AnnotationType, boolean, Object[]) instead with alias=null
static Restriction in(String alias, AnnotationType annotationType, boolean includeInheriting, Object... values)
          Create a restriction that searches for annotations on the root or a joined entity equal to any value in a list of given values.
static Restriction like(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use like(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction like(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations matching a given value on the root or a joined entity of a query.
static Restriction lt(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use lt(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction lt(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations less than a given value on the root or a joined entity of a query.
static Restriction lteq(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use lteq(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction lteq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations less than or equal to a given value on the root or a joined entity of a query.
static Restriction neq(AnnotationType annotationType, Object value, boolean includeInheriting)
          Deprecated. Use neq(String, AnnotationType, Object, boolean) instead with alias=null
static Restriction neq(String alias, AnnotationType annotationType, Object value, boolean includeInheriting)
          Create a restriction that searches for annotations not equal to a given value on the root or a joined entity of a query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Annotations

public Annotations()
Method Detail

eq

public static Restriction eq(AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Deprecated. Use eq(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations equal to a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

eq

public static Restriction eq(String alias,
                             AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Create a restriction that searches for annotations equal to a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType or value are null.
Since:
2.4

neq

public static Restriction neq(AnnotationType annotationType,
                              Object value,
                              boolean includeInheriting)
                       throws InvalidDataException
Deprecated. Use neq(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations not equal to a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

neq

public static Restriction neq(String alias,
                              AnnotationType annotationType,
                              Object value,
                              boolean includeInheriting)
                       throws InvalidDataException
Create a restriction that searches for annotations not equal to a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restrictions to use for annotations.
Throws:
InvalidDataException - If annotationType or value are null.
Since:
2.4

lt

public static Restriction lt(AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Deprecated. Use lt(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations less than a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

lt

public static Restriction lt(String alias,
                             AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Create a restriction that searches for annotations less than a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType parameter or value parameter are null.
Since:
2.4

lteq

public static Restriction lteq(AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Deprecated. Use lteq(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations less than or equal to a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

lteq

public static Restriction lteq(String alias,
                               AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Create a restriction that searches for annotations less than or equal to a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType parameter or value parameter are null.
Since:
2.4

gt

public static Restriction gt(AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Deprecated. Use gt(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations greater than a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

gt

public static Restriction gt(String alias,
                             AnnotationType annotationType,
                             Object value,
                             boolean includeInheriting)
                      throws InvalidDataException
Create a restriction that searches for annotations greater than a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType parameter or value parameter are null.
Since:
2.4

gteq

public static Restriction gteq(AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Deprecated. Use gteq(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations greater than or equal to a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

gteq

public static Restriction gteq(String alias,
                               AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Create a restriction that searches for annotations greater than or equal to a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on on annotations.
Throws:
InvalidDataException - If annotationType parameter or value parameter are null.
Since:
2.4

like

public static Restriction like(AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Deprecated. Use like(String, AnnotationType, Object, boolean) instead with alias=null

Create a restriction that searches for annotations matching a given value on the root entity of a query.

Parameters:
annotationType - The annotation type to search
value - The value to search for
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

like

public static Restriction like(String alias,
                               AnnotationType annotationType,
                               Object value,
                               boolean includeInheriting)
                        throws InvalidDataException
Create a restriction that searches for annotations matching a given value on the root or a joined entity of a query.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
value - The value to search for. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType parameter or value parameter are null.
Since:
2.4

between

public static Restriction between(AnnotationType annotationType,
                                  Object lowValue,
                                  Object highValue,
                                  boolean includeInheriting)
                           throws InvalidDataException
Deprecated. Use between(String, AnnotationType, Object, Object, boolean) instead with alias=null

Create a restriction that searches for annotations between two given values on the root entity of a query. If the end values are included or excluded depends on the database.

Parameters:
annotationType - The annotation type to search
lowValue - The lower bound
highValue - The higher bound
includeInheriting - If items inherting the annotation should be returned by the query or not
Throws:
InvalidDataException

between

public static Restriction between(String alias,
                                  AnnotationType annotationType,
                                  Object lowValue,
                                  Object highValue,
                                  boolean includeInheriting)
                           throws InvalidDataException
Create a restriction that searches for annotations between two given values on the root or a joined entity of a query. If the end values are included or excluded depends on the database.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
lowValue - The lower bound. Can not be null.
highValue - The higher bound. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If any of the required parameters are null.
Since:
2.4

in

public static Restriction in(AnnotationType annotationType,
                             boolean includeInheriting,
                             Object... values)
                      throws InvalidDataException
Deprecated. Use in(String, AnnotationType, boolean, Object[]) instead with alias=null

Create a restriction that searches for annotations on the root entity of a query equal to any value in a list of given values.

Parameters:
annotationType - The annotation type to search
includeInheriting - If items inherting the annotation should be returned by the query or not
values - An array of values
Throws:
InvalidDataException

in

public static Restriction in(String alias,
                             AnnotationType annotationType,
                             boolean includeInheriting,
                             Object... values)
                      throws InvalidDataException
Create a restriction that searches for annotations on the root or a joined entity equal to any value in a list of given values.

Parameters:
alias - The alias of the joined entity or null to use the root element
annotationType - The annotation type to search. Can not be null.
includeInheriting - If items inheriting the annotation should be returned by the query or not
values - An array of values. Can not be null.
Returns:
A restriction on annotations.
Throws:
InvalidDataException - If annotationType parameter or values parameter are null
Since:
2.4

2.17.2: 2011-06-17