public class CrudControllerBean extends Object implements CrudControllerLocal
Constructor and Description |
---|
CrudControllerBean() |
Modifier and Type | Method and Description |
---|---|
<T> T |
findById(Class<T> type,
Number primaryKey)
Finds a persisted entity by its primary key.
|
<T> List<T> |
findByNamedQuery(Class<T> type,
String queryName,
Map<String,Object> queryParameters)
Finds entities using a named query with the supplied queryName.
|
<T> T |
merge(T entity)
Merges the supplied entity with the persisted state of the supplied entity.
|
<T> T |
persist(T entity)
Persists (creates) the supplied entity.
|
<T> void |
remove(Class<T> type,
Number primaryKey)
Removes a previously persisted entity.
|
String |
testLocal()
Simple test method to verify this controller works using a local call.
|
String |
testRemote()
Simple test method to verify this controller works using a remote call.
|
public String testRemote()
testRemote
in interface CrudControllerRemote
public String testLocal()
testLocal
in interface CrudControllerLocal
public <T> T persist(T entity)
persist
in interface CrudControllerRemote
T
- The type of entity to persist.entity
- The entity to persist.public <T> T findById(Class<T> type, Number primaryKey)
findById
in interface CrudControllerRemote
T
- The type of the entity to find.type
- The class type of the entity to find.primaryKey
- The primary key of the entity to find.public <T> T merge(T entity)
merge
in interface CrudControllerRemote
T
- The type of the entity to merge.entity
- The entity to merge.public <T> void remove(Class<T> type, Number primaryKey)
remove
in interface CrudControllerRemote
T
- The type of the entity to remove.type
- The class type of the entity to remove.primaryKey
- The primary key of the entity to remove.public <T> List<T> findByNamedQuery(Class<T> type, String queryName, Map<String,Object> queryParameters)
findByNamedQuery
in interface CrudControllerRemote
T
- The type of the entities to find.type
- The class type of the entities to find.queryName
- Name of the named query.queryParameters
- Query parameters of the named query or null when no query parameters exist.Copyright © 2008–2018. All rights reserved.