1 package org.hibernate.event; 3 4 5 9 public class DeleteEvent extends AbstractEvent { 10 11 private Object object; 12 private String entityName; 13 private boolean cascadeDeleteEnabled; 14 15 21 public DeleteEvent(Object object, EventSource source) { 22 super(source); 23 if (object == null) { 24 throw new IllegalArgumentException ( 25 "attempt to create delete event with null entity" 26 ); 27 } 28 this.object = object; 29 } 30 31 public DeleteEvent(String entityName, Object object, EventSource source) { 32 this(object, source); 33 this.entityName = entityName; 34 } 35 36 public DeleteEvent(String entityName, Object object, boolean isCascadeDeleteEnabled, EventSource source) { 37 this(object, source); 38 this.entityName = entityName; 39 cascadeDeleteEnabled = isCascadeDeleteEnabled; 40 } 41 42 47 public Object getObject() { 48 return object; 49 } 50 51 public String getEntityName() { 52 return entityName; 53 } 54 55 public boolean isCascadeDeleteEnabled() { 56 return cascadeDeleteEnabled; 57 } 58 59 } 60 | Popular Tags |