1 package org.hibernate.event; 3 4 import java.io.Serializable ; 5 6 11 public class MergeEvent extends AbstractEvent { 12 13 private Object original; 14 private Serializable requestedId; 15 private String entityName; 16 private Object entity; 17 18 public MergeEvent(String entityName, Object original, EventSource source) { 19 this(original, source); 20 this.entityName = entityName; 21 } 22 23 public MergeEvent(String entityName, Object original, Serializable id, EventSource source) { 24 this(entityName, original, source); 25 this.requestedId = id; 26 if ( requestedId == null ) { 27 throw new IllegalArgumentException ( 28 "attempt to create merge event with null identifier" 29 ); 30 } 31 } 32 33 public MergeEvent(Object object, EventSource source) { 34 super(source); 35 if ( object == null ) { 36 throw new IllegalArgumentException ( 37 "attempt to create merge event with null entity" 38 ); 39 } 40 this.original = object; 41 } 42 43 public Object getOriginal() { 44 return original; 45 } 46 47 public void setOriginal(Object object) { 48 this.original = object; 49 } 50 51 public Serializable getRequestedId() { 52 return requestedId; 53 } 54 55 public void setRequestedId(Serializable requestedId) { 56 this.requestedId = requestedId; 57 } 58 59 public String getEntityName() { 60 return entityName; 61 } 62 63 public void setEntityName(String entityName) { 64 this.entityName = entityName; 65 } 66 67 public Object getEntity() { 68 return entity; 69 } 70 public void setEntity(Object entity) { 71 this.entity = entity; 72 } 73 } 74 | Popular Tags |