com.vaadin.addon.jpacontainer
Interface QueryModifierDelegate

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultQueryModifierDelegate

public interface QueryModifierDelegate
extends Serializable

The QueryModifierDelegate interface defines methods that will be called at the different stages of CriteriaQuery generation. Implement this interface and call EntityProvider.setQueryModifierDelegate(QueryModifierDelegate) to receive calls while the CriteriaQuery is being built. The methods are allowed to modify the CriteriaQuery.

Since:
2.0

Method Summary
 void filtersWereAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query)
          This method is called after all filters have been applied to the query.
 void filtersWillBeAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query, List<javax.persistence.criteria.Predicate> predicates)
          This method is called after filters (in the form of Container.Filter) have been translated into instances of Predicate, but before the resulting predicates have been added to query.
 void orderByWasAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query)
          This method is called after the order by has been applied for the query.
 void orderByWillBeAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query, List<javax.persistence.criteria.Order> orderBy)
          This method is called after all SortBy instances have been translated into Order instances, but before they have been applied to the query.
 void queryHasBeenBuilt(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query)
          This method is called after the CriteriaQuery instance has been completely built (configured).
 void queryWillBeBuilt(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> query)
          This method is called after the CriteriaQuery instance ( query) has been instantiated, but before any state has been set.
 

Method Detail

queryWillBeBuilt

void queryWillBeBuilt(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                      javax.persistence.criteria.CriteriaQuery<?> query)
This method is called after the CriteriaQuery instance ( query) has been instantiated, but before any state has been set. Operations and configuration may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built

queryHasBeenBuilt

void queryHasBeenBuilt(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                       javax.persistence.criteria.CriteriaQuery<?> query)
This method is called after the CriteriaQuery instance has been completely built (configured). Any operations may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built

filtersWillBeAdded

void filtersWillBeAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                        javax.persistence.criteria.CriteriaQuery<?> query,
                        List<javax.persistence.criteria.Predicate> predicates)
This method is called after filters (in the form of Container.Filter) have been translated into instances of Predicate, but before the resulting predicates have been added to query. The contents of the predicates list may be modified at this point. Any operations may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built
predicates - the list of predicates (Predicate) to be applied. The contents of this list may be modified.

filtersWereAdded

void filtersWereAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                      javax.persistence.criteria.CriteriaQuery<?> query)
This method is called after all filters have been applied to the query. Any operations may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built

orderByWillBeAdded

void orderByWillBeAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                        javax.persistence.criteria.CriteriaQuery<?> query,
                        List<javax.persistence.criteria.Order> orderBy)
This method is called after all SortBy instances have been translated into Order instances, but before they have been applied to the query. The contents of the orderBy list may be modified at this point. Any operations may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built
orderBy - the list of order by rules (Order) to be applied. The contents of this list may be modified.

orderByWasAdded

void orderByWasAdded(javax.persistence.criteria.CriteriaBuilder criteriaBuilder,
                     javax.persistence.criteria.CriteriaQuery<?> query)
This method is called after the order by has been applied for the query. Any operations may be performed on the query instance.

Parameters:
criteriaBuilder - the CriteriaBuilder used to build the query
query - the CriteriaQuery being built


Copyright © 2013 Vaadin Ltd. All rights reserved.