org.lazydog.repository.jpa.internal
Class CriteriaImpl<T>

java.lang.Object
  extended by org.lazydog.repository.jpa.internal.CriteriaImpl<T>
All Implemented Interfaces:
Serializable, Criteria<T>

public class CriteriaImpl<T>
extends Object
implements Criteria<T>, Serializable

Criteria implemented using the Java Persistence API.

Author:
Ron Rickard
See Also:
Serialized Form

Constructor Summary
CriteriaImpl(Class<T> entityClass)
          Constructor.
 
Method Summary
 Criteria<T> add(Criterion criterion)
          Add a restriction criterion.
 Criteria<T> add(List<Criterion> criterions)
          Add restriction criterions.
 Criteria<T> addJoin(Criterion criterion)
          Add a join criterion.
 Criteria<T> addJoins(List<Criterion> criterions)
          Add join criterions.
 Criteria<T> addOrder(Criterion criterion)
          Add a order criterion.
 Criteria<T> addOrders(List<Criterion> criterions)
          Add order criterions.
 Map<Object,String> getQueryHints()
          Get the query hints.
 String getQueryLanguageString()
          Get the query language string.
 Map<String,Object> getQueryParameters()
          Get the query parameters.
 boolean joinExists()
          Check if a join criterion exists.
 boolean orderExists()
          Check if a order criterion exists.
 boolean restrictionExists()
          Check if a restriction criterion exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaImpl

public CriteriaImpl(Class<T> entityClass)
Constructor.

Parameters:
entityClass - the entity class.
Throws:
IllegalArgumentException - if the entity class is invalid.
Method Detail

add

public Criteria<T> add(Criterion criterion)
Add a restriction criterion.

Specified by:
add in interface Criteria<T>
Parameters:
criterion - the restriction criterion.
Returns:
the criteria.

add

public Criteria<T> add(List<Criterion> criterions)
Add restriction criterions.

Specified by:
add in interface Criteria<T>
Parameters:
criterions - the restriction criterions.
Returns:
the criteria.

addJoin

public Criteria<T> addJoin(Criterion criterion)
Add a join criterion.

Parameters:
criterion - the join criterion.
Returns:
the criteria.

addJoins

public Criteria<T> addJoins(List<Criterion> criterions)
Add join criterions.

Parameters:
criterions - the join criterions.
Returns:
the criteria.

addOrder

public Criteria<T> addOrder(Criterion criterion)
Add a order criterion.

Specified by:
addOrder in interface Criteria<T>
Parameters:
criterion - the order criterion.
Returns:
the criteria.

addOrders

public Criteria<T> addOrders(List<Criterion> criterions)
Add order criterions.

Specified by:
addOrders in interface Criteria<T>
Parameters:
criterions - the order criterions.
Returns:
the criteria.

getQueryHints

public Map<Object,String> getQueryHints()
Get the query hints.

Returns:
the query hints.

getQueryLanguageString

public String getQueryLanguageString()
Get the query language string.

Returns:
the query language string.

getQueryParameters

public Map<String,Object> getQueryParameters()
Get the query parameters.

Returns:
the query parameters.

joinExists

public boolean joinExists()
Check if a join criterion exists.

Returns:
true if a join criterion exists, otherwise false.

orderExists

public boolean orderExists()
Check if a order criterion exists.

Specified by:
orderExists in interface Criteria<T>
Returns:
true if a order criterion exists, otherwise false.

restrictionExists

public boolean restrictionExists()
Check if a restriction criterion exists.

Specified by:
restrictionExists in interface Criteria<T>
Returns:
true if a restriction criterion exists, otherwise false.


Copyright © 2013 Lazydog. All Rights Reserved.