@Component(value="cuba_GroupEntityListener") public class GroupEntityListener extends java.lang.Object implements BeforeInsertEntityListener<Group>, BeforeUpdateEntityListener<Group>
Modifier and Type | Field and Description |
---|---|
protected Metadata |
metadata |
protected Persistence |
persistence |
Constructor and Description |
---|
GroupEntityListener() |
Modifier and Type | Method and Description |
---|---|
protected void |
createNewHierarchy(Group entity,
Group parent) |
void |
onBeforeInsert(Group entity,
EntityManager entityManager)
Executes before the object has been inserted into DB.
|
void |
onBeforeUpdate(Group entity,
EntityManager entityManager)
Executes before the object has been updated in DB.
|
@Inject protected Persistence persistence
@Inject protected Metadata metadata
public void onBeforeInsert(Group entity, EntityManager entityManager)
BeforeInsertEntityListener
onBeforeInsert
in interface BeforeInsertEntityListener<Group>
entity
- inserted entity instanceentityManager
- EntityManager that owns the entity instancepublic void onBeforeUpdate(Group entity, EntityManager entityManager)
BeforeUpdateEntityListener
onBeforeUpdate
in interface BeforeUpdateEntityListener<Group>
entity
- updated entity instanceentityManager
- EntityManager that owns the entity instance