Commit 01299d86 authored by Selvakumar Kamatchinathan's avatar Selvakumar Kamatchinathan
Browse files

IdentifiableEntity

parent c82623ad
......@@ -33,21 +33,21 @@ public class EntityEventListener {
}
@PostPersist
public void onPersistEntity(EntityIdentifier entity) {
public void onPersistEntity(IdentifiableEntity entity) {
sendNotification(entity, Event.CREATED);
}
@PostUpdate
public void onUpdateEntity(EntityIdentifier entity) {
public void onUpdateEntity(IdentifiableEntity entity) {
sendNotification(entity, Event.UPDATED);
}
@PostRemove
public void onRemoveEntity(EntityIdentifier entity) {
public void onRemoveEntity(IdentifiableEntity entity) {
sendNotification(entity, Event.REMOVED);
}
private void sendNotification(EntityIdentifier entity, Event event) {
private void sendNotification(IdentifiableEntity entity, Event event) {
BeanUtil.getBean(MailService.class).send(entity.getClass().getSimpleName() + " " + entity.getId() + " " + event);
}
......
......@@ -17,7 +17,7 @@
*/
package uk.ac.ebi.ampt2d.registry.entities;
public interface EntityIdentifier<ENTITY_ID> {
public interface IdentifiableEntity<ENTITY_ID> {
ENTITY_ID getId();
......
......@@ -35,7 +35,7 @@ import java.time.ZonedDateTime;
@Entity
@EntityListeners({AuditingEntityListener.class,EntityEventListener.class})
public class Phenotype implements EntityIdentifier<String>{
public class Phenotype implements IdentifiableEntity<String> {
public enum Group {
......
......@@ -36,7 +36,7 @@ import java.time.ZonedDateTime;
@Entity
@EntityListeners({AuditingEntityListener.class,EntityEventListener.class})
public class Property implements EntityIdentifier<String>{
public class Property implements IdentifiableEntity<String> {
public enum Type {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment