se.vgregion.dao.domain.patterns.repository.db.jpa
Interface JpaRepository<T extends Entity<T,ID>,ID extends Serializable,PK extends Serializable>

Type Parameters:
T - The Entity Type
ID - The ID of the Entity
PK - The type of the primary key
All Superinterfaces:
DatabaseRepository<T,ID,PK>, Repository<T,ID>
All Known Implementing Classes:
AbstractJpaRepository, DefaultJpaRepository

public interface JpaRepository<T extends Entity<T,ID>,ID extends Serializable,PK extends Serializable>
extends DatabaseRepository<T,ID,PK>

An extended repository interface specific for JPA

Author:
Anders Asplund - Callista Enterprise

Method Summary
 void clear()
          Clear the persistence context, causing all managed entities to become detached.
 List<T> findByNamedQuery(String queryName, Map<String,? extends Object> args)
          Find instances of T that match the criteria defined by query queryName.
 List<T> findByNamedQuery(String queryName, Object[] args)
          Find instances of T that match the criteria defined by query queryName.
 T findInstanceByNamedQuery(String queryName, Map<String,? extends Object> args)
          Find a single instance of T using the query named queryName and the arguments identified by args.
 T findInstanceByNamedQuery(String queryName, Object[] args)
          Find a single instance of T using the query named queryName and the arguments identified by args.
 
Methods inherited from interface se.vgregion.dao.domain.patterns.repository.db.DatabaseRepository
findByPrimaryKey, removeByPrimaryKey
 
Methods inherited from interface se.vgregion.dao.domain.patterns.repository.Repository
contains, find, findAll, flush, merge, persist, refresh, remove, remove, store
 

Method Detail

clear

void clear()
Clear the persistence context, causing all managed entities to become detached. Changes made to entities that have not been flushed to the storage will not be persisted.


findByNamedQuery

List<T> findByNamedQuery(String queryName,
                         Map<String,? extends Object> args)
Find instances of T that match the criteria defined by query queryName. args provide the values for any named parameters in the query identified by queryName.

Parameters:
queryName - the named query to execute
args - the values used by the query
Returns:
a list of T objects

findByNamedQuery

List<T> findByNamedQuery(String queryName,
                         Object[] args)
Find instances of T that match the criteria defined by query queryName. args provide values for positional arguments in the query identified by queryName.

Parameters:
queryName - the named query to execute
args - the positional values used in the query
Returns:
a list of T objects

findInstanceByNamedQuery

T findInstanceByNamedQuery(String queryName,
                           Object[] args)
Find a single instance of T using the query named queryName and the arguments identified by args.

Parameters:
queryName - the name of the query to use
args - the arguments for the named query
Returns:
T or null if no objects match the criteria if more than one instance is returned.

findInstanceByNamedQuery

T findInstanceByNamedQuery(String queryName,
                           Map<String,? extends Object> args)
Find a single instance of T using the query named queryName and the arguments identified by args.

Parameters:
queryName - the name of the query to use
args - a Map holding the named parameters of the query
Returns:
T or null if no objects match the criteria if more than one instance is returned.


Copyright © 2010. All Rights Reserved.