Top Description Constructors Methods
org.hibernate.criterion

public Class Property

extends PropertyProjection
Class Inheritance
Imports
java.util.Collection

A factory for property-specific criterion and projection instances
Authors
Gavin King, Steve Ebersole

Constructor Summary

AccessConstructor and Description
protected
Property(String
The property name.
propertyName
)

Constructs a Property.

Method Summary

Modifier and TypeMethod and Description
public Order

Returns:

The order
asc
()

Creates an ascending ordering for this property

public AggregateProjection

Returns:

The projection
avg
()

Creates a property avg projection

public Criterion

Returns:

The BETWEEN restriction
between
(Object
The minimum
min
,
Object
The maximum
max
)

Creates a BETWEEN restriction for this property between the given min and max

public CountProjection

Returns:

The projection
count
()

Creates a property count projection

public Order

Returns:

The order
desc
()

Creates a descending ordering for this property

public SimpleExpression

Returns:

The equality restriction.
eq
(Object
The value to check against
value
)

Creates an equality restriction.

public Criterion

Returns:

The expression
eq
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query equality expression for this property

public Criterion

Returns:

The expression
eqAll
(DetachedCriteria
The sub-query
subselect
)

Creates a equals-all sub-query expression for this property.

public Criterion

Returns:

The equality restriction.
eqOrIsNull
(Object
The value to check against
value
)

Creates an equality restriction capable of also rendering as IS NULL if the given value is null

public PropertyExpression

Returns:

The restriction
eqProperty
(Property
The other property to compare against
other
)

Creates an equality restriction between 2 properties

public PropertyExpression

Returns:

The restriction
eqProperty
(String
The other property to compare against
other
)

Creates an equality restriction between 2 properties

public static Property

Returns:

The Property instance
forName
(String
The name of the property.
propertyName
)

Factory for Property instances.

public SimpleExpression

Returns:

The greater-than-or-equal-to restriction
ge
(Object
The value to check against
value
)

Create a greater-than-or-equal-to restriction based on this property

public Criterion

Returns:

The expression
ge
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query greater-than-or-equal-to expression for this property

public Criterion

Returns:

The expression
geAll
(DetachedCriteria
The sub-query
subselect
)

Creates a greater-than-or-equal-to-all sub-query expression for this property.

public PropertyExpression

Returns:

The restriction
geProperty
(Property
The other property to compare against
other
)

Creates a greater-than-or-equal-to restriction between 2 properties

public PropertyExpression

Returns:

The restriction
geProperty
(String
The other property to compare against
other
)

Creates a greater-than-or-equal-to restriction between 2 properties

public Criterion

Returns:

The expression
geSome
(DetachedCriteria
The sub-query
subselect
)

Creates a greater-than-or-equal-to-some sub-query expression for this property.

public Property

Returns:

The property
getProperty
(String
The sub property name
propertyName
)

Get a component attribute of this property.

public PropertyProjection

Returns:

The group projection
group
()

Creates a projection for this property as a group expression

public SimpleExpression

Returns:

The greater-than restriction
gt
(Object
The value to check against
value
)

Create a greater-than restriction based on this property

public Criterion

Returns:

The expression
gt
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query greater-than expression for this property

public Criterion

Returns:

The expression
gtAll
(DetachedCriteria
The sub-query
subselect
)

Creates a greater-than-all sub-query expression for this property.

public PropertyExpression

Returns:

The restriction
gtProperty
(Property
The other property to compare against
other
)

Creates a greater-than restriction between 2 properties

public PropertyExpression

Returns:

The restriction
gtProperty
(String
The other property to compare against
other
)

Creates a greater-than restriction between 2 properties

public Criterion

Returns:

The expression
gtSome
(DetachedCriteria
The sub-query
subselect
)

Creates a greater-than-some sub-query expression for this property.

public Criterion

Returns:

The IN restriction
in
(Collection<E>
The literal values
values
)

Creates an IN restriction for this property based on the given list of literals

public Criterion

Returns:

The IN restriction
in
(Object...
The literal values
values
)

Creates an IN restriction for this property based on the given list of literals

public Criterion

Returns:

The expression
in
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query IN expression for this property.

public Criterion

Returns:

The restriction
isEmpty
()

Creates a restriction to check that a collection is empty

public Criterion

Returns:

The restriction
isNotEmpty
()

Creates a restriction to check that a collection is not empty

public Criterion

Returns:

The restriction
isNotNull
()

Creates a NOT NULL restriction

public Criterion

Returns:

The restriction
isNull
()

Creates a NULL restriction

public SimpleExpression

Returns:

The less-than-or-equal-to restriction
le
(Object
The value to check against
value
)

Create a less-than-or-equal-to restriction based on this property

public Criterion

Returns:

The expression
le
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query less-than-or-equal-to expression for this property

public Criterion

Returns:

The expression
leAll
(DetachedCriteria
The sub-query
subselect
)

Creates a less-than-or-equal-to-all sub-query expression for this property.

public PropertyExpression

Returns:

The restriction
leProperty
(Property
The other property to compare against
other
)

Creates a less-than-or-equal-to restriction between 2 properties

public PropertyExpression

Returns:

The restriction
leProperty
(String
The other property to compare against
other
)

Creates a less-than-or-equal-to restriction between 2 properties

public Criterion

Returns:

The expression
leSome
(DetachedCriteria
The sub-query
subselect
)

Creates a less-than-or-equal-to-some sub-query expression for this property.

public SimpleExpression

Returns:

The LIKE restriction
like
(Object
The value to like compare with
value
)

Creates a LIKE restriction for this property

public SimpleExpression

Returns:

The LIKE restriction
like
(String
The value to like compare with
value
,
MatchMode
The match mode to apply to the LIKE
matchMode
)

Creates a LIKE restriction for this property

public SimpleExpression

Returns:

The less-than restriction
lt
(Object
The value to check against
value
)

Create a less-than restriction based on this property

public Criterion

Returns:

The expression
lt
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query less-than expression for this property

public Criterion

Returns:

The expression
ltAll
(DetachedCriteria
The sub-query
subselect
)

Creates a less-than-all sub-query expression for this property.

public PropertyExpression

Returns:

The restriction
ltProperty
(Property
The other property to compare against
other
)

Creates a less-than restriction between 2 properties

public PropertyExpression

Returns:

The restriction
ltProperty
(String
The other property to compare against
other
)

Creates a less-than restriction between 2 properties

public Criterion

Returns:

The expression
ltSome
(DetachedCriteria
The sub-query
subselect
)

Creates a less-than-some sub-query expression for this property.

public AggregateProjection

Returns:

The projection
max
()

Creates a property max projection

public AggregateProjection

Returns:

The projection
min
()

Creates a property min projection

public SimpleExpression

Returns:

The non-equality restriction.
ne
(Object
The value to check against
value
)

Creates a non-equality restriction.

public Criterion

Returns:

The expression
ne
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query non-equality expression for this property

public Criterion

Returns:

The non-equality restriction.
neOrIsNotNull
(Object
The value to check against
value
)

Creates a non-equality restriction capable of also rendering as IS NOT NULL if the given value is null

public PropertyExpression

Returns:

The restriction
neProperty
(Property
The other property to compare against
other
)

Creates a non-equality restriction between 2 properties

public PropertyExpression

Returns:

The restriction
neProperty
(String
The other property to compare against
other
)

Creates a non-equality restriction between 2 properties

public Criterion

Returns:

The expression
notIn
(DetachedCriteria
The sub-query
subselect
)

Creates a sub-query NOT IN expression for this property.

Inherited from org.hibernate.criterion.PropertyProjection:
getPropertyNamegetTypesisGroupedtoGroupSqlStringtoSqlStringtoString

Constructor Detail

Propertyback to summary
protected Property(String propertyName)

Constructs a Property. non-private to allow subclassing.

Parameters
propertyName:String

The property name.

Method Detail

ascback to summary
public Order asc()

Creates an ascending ordering for this property

Returns:Order

The order

avgback to summary
public AggregateProjection avg()

Creates a property avg projection

Returns:AggregateProjection

The projection

See Also
Projections#avg
betweenback to summary
public Criterion between(Object min, Object max)

Creates a BETWEEN restriction for this property between the given min and max

Parameters
min:Object

The minimum

max:Object

The maximum

Returns:Criterion

The BETWEEN restriction

See Also
Restrictions#between(String, Object, Object)
countback to summary
public CountProjection count()

Creates a property count projection

Returns:CountProjection

The projection

See Also
Projections#count
descback to summary
public Order desc()

Creates a descending ordering for this property

Returns:Order

The order

eqback to summary
public SimpleExpression eq(Object value)

Creates an equality restriction.

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The equality restriction.

See Also
Restrictions#eq(String, Object)
eqback to summary
public Criterion eq(DetachedCriteria subselect)

Creates a sub-query equality expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyEq(String, DetachedCriteria)
eqAllback to summary
public Criterion eqAll(DetachedCriteria subselect)

Creates a equals-all sub-query expression for this property. I.e., [prop] = ALL [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyEqAll(String, DetachedCriteria)
eqOrIsNullback to summary
public Criterion eqOrIsNull(Object value)

Creates an equality restriction capable of also rendering as IS NULL if the given value is null

Parameters
value:Object

The value to check against

Returns:Criterion

The equality restriction.

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#eqOrIsNull(String, Object), eq, isNull
eqPropertyback to summary
public PropertyExpression eqProperty(Property other)

Creates an equality restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#eqProperty(String, String)
eqPropertyback to summary
public PropertyExpression eqProperty(String other)

Creates an equality restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#eqProperty(String, String)
forNameback to summary
public static Property forName(String propertyName)

Factory for Property instances.

Parameters
propertyName:String

The name of the property.

Returns:Property

The Property instance

geback to summary
public SimpleExpression ge(Object value)

Create a greater-than-or-equal-to restriction based on this property

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The greater-than-or-equal-to restriction

See Also
Restrictions#ge(String, Object)
geback to summary
public Criterion ge(DetachedCriteria subselect)

Creates a sub-query greater-than-or-equal-to expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyGe(String, DetachedCriteria)
geAllback to summary
public Criterion geAll(DetachedCriteria subselect)

Creates a greater-than-or-equal-to-all sub-query expression for this property. I.e., [prop] >= ALL [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyGeAll(String, DetachedCriteria)
gePropertyback to summary
public PropertyExpression geProperty(Property other)

Creates a greater-than-or-equal-to restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#geProperty(String, String)
gePropertyback to summary
public PropertyExpression geProperty(String other)

Creates a greater-than-or-equal-to restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#geProperty(String, String)
geSomeback to summary
public Criterion geSome(DetachedCriteria subselect)

Creates a greater-than-or-equal-to-some sub-query expression for this property. I.e., [prop] >= SOME [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyGeSome(String, DetachedCriteria)
getPropertyback to summary
public Property getProperty(String propertyName)

Get a component attribute of this property.

Parameters
propertyName:String

The sub property name

Returns:Property

The property

groupback to summary
public PropertyProjection group()

Creates a projection for this property as a group expression

Returns:PropertyProjection

The group projection

See Also
Projections#groupProperty
gtback to summary
public SimpleExpression gt(Object value)

Create a greater-than restriction based on this property

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The greater-than restriction

See Also
Restrictions#gt(String, Object)
gtback to summary
public Criterion gt(DetachedCriteria subselect)

Creates a sub-query greater-than expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyGt(String, DetachedCriteria)
gtAllback to summary
public Criterion gtAll(DetachedCriteria subselect)

Creates a greater-than-all sub-query expression for this property. I.e., [prop] > ALL [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyGtAll(String, DetachedCriteria)
gtPropertyback to summary
public PropertyExpression gtProperty(Property other)

Creates a greater-than restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#geProperty(String, String)
gtPropertyback to summary
public PropertyExpression gtProperty(String other)

Creates a greater-than restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#geProperty(String, String)
gtSomeback to summary
public Criterion gtSome(DetachedCriteria subselect)

Creates a greater-than-some sub-query expression for this property. I.e., [prop] > SOME [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyGtSome(String, DetachedCriteria)
inback to summary
public Criterion in(Collection<E> values)

Creates an IN restriction for this property based on the given list of literals

Parameters
values:Collection<E>

The literal values

Returns:Criterion

The IN restriction

See Also
Restrictions#in(String, Collection)
inback to summary
public Criterion in(Object... values)

Creates an IN restriction for this property based on the given list of literals

Parameters
values:Object[]

The literal values

Returns:Criterion

The IN restriction

See Also
Restrictions#in(String, Object[])
inback to summary
public Criterion in(DetachedCriteria subselect)

Creates a sub-query IN expression for this property. I.e., [prop] IN [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyIn(String, DetachedCriteria)
isEmptyback to summary
public Criterion isEmpty()

Creates a restriction to check that a collection is empty

Returns:Criterion

The restriction

See Also
Restrictions#isEmpty(String)
isNotEmptyback to summary
public Criterion isNotEmpty()

Creates a restriction to check that a collection is not empty

Returns:Criterion

The restriction

See Also
Restrictions#isNotEmpty(String)
isNotNullback to summary
public Criterion isNotNull()

Creates a NOT NULL restriction

Returns:Criterion

The restriction

See Also
Restrictions#isNotNull(String)
isNullback to summary
public Criterion isNull()

Creates a NULL restriction

Returns:Criterion

The restriction

See Also
Restrictions#isNull(String)
leback to summary
public SimpleExpression le(Object value)

Create a less-than-or-equal-to restriction based on this property

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The less-than-or-equal-to restriction

See Also
Restrictions#le(String, Object)
leback to summary
public Criterion le(DetachedCriteria subselect)

Creates a sub-query less-than-or-equal-to expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyLe(String, DetachedCriteria)
leAllback to summary
public Criterion leAll(DetachedCriteria subselect)

Creates a less-than-or-equal-to-all sub-query expression for this property. I.e., [prop] <= ALL [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyLeAll(String, DetachedCriteria)
lePropertyback to summary
public PropertyExpression leProperty(Property other)

Creates a less-than-or-equal-to restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#leProperty(String, String)
lePropertyback to summary
public PropertyExpression leProperty(String other)

Creates a less-than-or-equal-to restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#leProperty(String, String)
leSomeback to summary
public Criterion leSome(DetachedCriteria subselect)

Creates a less-than-or-equal-to-some sub-query expression for this property. I.e., [prop] <= SOME [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyLeSome(String, DetachedCriteria)
likeback to summary
public SimpleExpression like(Object value)

Creates a LIKE restriction for this property

Parameters
value:Object

The value to like compare with

Returns:SimpleExpression

The LIKE restriction

See Also
Restrictions#like(String, Object)
likeback to summary
public SimpleExpression like(String value, MatchMode matchMode)

Creates a LIKE restriction for this property

Parameters
value:String

The value to like compare with

matchMode:MatchMode

The match mode to apply to the LIKE

Returns:SimpleExpression

The LIKE restriction

See Also
Restrictions#like(String, String, MatchMode)
ltback to summary
public SimpleExpression lt(Object value)

Create a less-than restriction based on this property

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The less-than restriction

See Also
Restrictions#lt(String, Object)
ltback to summary
public Criterion lt(DetachedCriteria subselect)

Creates a sub-query less-than expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyLt(String, DetachedCriteria)
ltAllback to summary
public Criterion ltAll(DetachedCriteria subselect)

Creates a less-than-all sub-query expression for this property. I.e., [prop] < ALL [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyLtAll(String, DetachedCriteria)
ltPropertyback to summary
public PropertyExpression ltProperty(Property other)

Creates a less-than restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#ltProperty(String, String)
ltPropertyback to summary
public PropertyExpression ltProperty(String other)

Creates a less-than restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#ltProperty(String, String)
ltSomeback to summary
public Criterion ltSome(DetachedCriteria subselect)

Creates a less-than-some sub-query expression for this property. I.e., [prop] < SOME [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyLtSome(String, DetachedCriteria)
maxback to summary
public AggregateProjection max()

Creates a property max projection

Returns:AggregateProjection

The projection

See Also
Projections#max
minback to summary
public AggregateProjection min()

Creates a property min projection

Returns:AggregateProjection

The projection

See Also
Projections#min
neback to summary
public SimpleExpression ne(Object value)

Creates a non-equality restriction.

Parameters
value:Object

The value to check against

Returns:SimpleExpression

The non-equality restriction.

See Also
Restrictions#ne(String, Object)
neback to summary
public Criterion ne(DetachedCriteria subselect)

Creates a sub-query non-equality expression for this property

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

See Also
Subqueries#propertyNe(String, DetachedCriteria)
neOrIsNotNullback to summary
public Criterion neOrIsNotNull(Object value)

Creates a non-equality restriction capable of also rendering as IS NOT NULL if the given value is null

Parameters
value:Object

The value to check against

Returns:Criterion

The non-equality restriction.

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#neOrIsNotNull(String, Object), ne, isNotNull
nePropertyback to summary
public PropertyExpression neProperty(Property other)

Creates a non-equality restriction between 2 properties

Parameters
other:Property

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#neProperty(String, String)
nePropertyback to summary
public PropertyExpression neProperty(String other)

Creates a non-equality restriction between 2 properties

Parameters
other:String

The other property to compare against

Returns:PropertyExpression

The restriction

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Restrictions#neProperty(String, String)
notInback to summary
public Criterion notIn(DetachedCriteria subselect)

Creates a sub-query NOT IN expression for this property. I.e., [prop] NOT IN [subquery]

Parameters
subselect:DetachedCriteria

The sub-query

Returns:Criterion

The expression

Annotations
@SuppressWarnings:UnusedDeclaration
See Also
Subqueries#propertyNotIn(String, DetachedCriteria)