Interface EntityViewRepository<E,V,PK extends Serializable>
- Type Parameters:
E- Entity type.V- Entity view type.PK- Primary key type.
- All Superinterfaces:
org.apache.deltaspike.core.spi.activation.Deactivatable
- All Known Subinterfaces:
FullEntityViewRepository<E,V,PK>
public interface EntityViewRepository<E,V,PK extends Serializable>
extends org.apache.deltaspike.core.spi.activation.Deactivatable
Base entity view repository interface. All methods are implemented by the CDI extension.
- Since:
- 1.2.0
- Author:
- Moritz Becker
-
Method Summary
Modifier and Type Method Description List<V>findAll()Lookup all existing entities of entity class<E>.List<V>findAll(int start, int max)Lookup a range of existing entities of entity class<E>with support for pagination.Page<V>findAll(Pageable pageable)Iterable<V>findAll(Sort sort)Lookup a range of existing entities of entity class<E>with support for pagination.Page<V>findAll(Specification<E> specification, Pageable pageable)Returns aPageof entities meeting the paging and specification restriction provided in thePageableandSpecificationobjects.List<V>findBy(E example, int start, int max, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties with support for pagination.List<V>findBy(E example, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties.VfindBy(PK primaryKey)Entity lookup by primary key.List<V>findByLike(E example, int start, int max, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties using a like operator for Strings with support for pagination.List<V>findByLike(E example, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties using a like operator for Strings.
-
Method Details
-
findBy
Entity lookup by primary key. Convenicence method aroundEntityManager.find(Class, Object).- Parameters:
primaryKey- DB primary key.- Returns:
- Entity identified by primary or null if it does not exist.
-
findAll
Lookup all existing entities of entity class<E>.- Returns:
- List of entities, empty if none found.
-
findAll
Lookup a range of existing entities of entity class<E>with support for pagination.- Parameters:
start- The starting position.max- The maximum number of results to return- Returns:
- List of entities, empty if none found.
-
findAll
Lookup a range of existing entities of entity class<E>with support for pagination.- Parameters:
sort- The sorting- Returns:
- all entities sorted by the given options
-
findAll
- Parameters:
pageable- The paging configuration- Returns:
- a page of entities
-
findAll
Returns aPageof entities meeting the paging and specification restriction provided in thePageableandSpecificationobjects.- Parameters:
specification- The specification restricting the resultspageable- The paging configuration- Returns:
- a page of entities
-
findBy
Query by example - for a given object and a specific set of properties.- Parameters:
example- Sample entity. Query all like.attributes- Which attributes to consider for the query.- Returns:
- List of entities matching the example, or empty if none found.
-
findBy
List<V> findBy(E example, int start, int max, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties with support for pagination.- Parameters:
example- Sample entity. Query all like.start- The starting position.max- The maximum number of results to returnattributes- Which attributes to consider for the query.- Returns:
- List of entities matching the example, or empty if none found.
-
findByLike
Query by example - for a given object and a specific set of properties using a like operator for Strings.- Parameters:
example- Sample entity. Query all like.attributes- Which attributes to consider for the query.- Returns:
- List of entities matching the example, or empty if none found.
-
findByLike
List<V> findByLike(E example, int start, int max, javax.persistence.metamodel.SingularAttribute<E,?>... attributes)Query by example - for a given object and a specific set of properties using a like operator for Strings with support for pagination.- Parameters:
example- Sample entity. Query all like.start- The starting position.max- The maximum number of results to returnattributes- Which attributes to consider for the query.- Returns:
- List of entities matching the example, or empty if none found.
-