T - The Persistable to maintain.@Status(stage=DEVELOPMENT, unitTests=ABSENT) public abstract class AbstractCrudChildControllerBean<T extends Persistable> extends Object
| Constructor and Description |
|---|
AbstractCrudChildControllerBean() |
| Modifier and Type | Method and Description |
|---|---|
T |
findById(Long id)
Finds an Entity with the supplied id.
|
javax.persistence.EntityManager |
getEntityManager()
Gets the Entity Manager.
|
abstract Class<T> |
getItemType()
Gets the type of the Entity to maintain.
|
T |
merge(T entity)
Merges the supplied entity.
|
void |
persist(T entity,
Long parentId)
Persists the supplied entity.
|
abstract void |
prePersist(T childEntity,
Long parentId)
Fetches the Entity with the supplied parentId and sets it on the supplied
childEntity.
|
void |
remove(T entity)
Removes the Entity with the supplied id.
|
public abstract Class<T> getItemType()
public javax.persistence.EntityManager getEntityManager()
public void persist(T entity, Long parentId)
entity - The Entity to persist.parentId - Object ID of the parent Entity.NullPointerException - When the supplied entity is null.javax.persistence.PersistenceException - When the persist operation
failed.public abstract void prePersist(T childEntity, Long parentId)
childEntity - The child Entity.parentId - The Object ID of the parent to which the supplied
childEntity belongs.public T merge(T entity)
entity - The Entity to merge.NullPointerException - When the supplied entity is null.javax.persistence.PersistenceException - when the merge operation
failed.public void remove(T entity)
entity - The Entity to remove.NullPointerException - When the supplied entity is null.javax.persistence.PersistenceException - when the remove operation
failed.public T findById(Long id)
id - The ID of the Entity to find.NullPointerException - When the supplied id is null.Copyright © 2008–2017. All rights reserved.