01: //$Id: MergeEvent.java 7785 2005-08-08 23:24:44Z oneovthafew $
02: package org.hibernate.event;
03:
04: import java.io.Serializable;
05:
06: /**
07: * An event class for merge() and saveOrUpdateCopy()
08: *
09: * @author Gavin King
10: */
11: public class MergeEvent extends AbstractEvent {
12:
13: private Object original;
14: private Serializable requestedId;
15: private String entityName;
16: private Object entity;
17: private Object result;
18:
19: public MergeEvent(String entityName, Object original,
20: EventSource source) {
21: this (original, source);
22: this .entityName = entityName;
23: }
24:
25: public MergeEvent(String entityName, Object original,
26: Serializable id, EventSource source) {
27: this (entityName, original, source);
28: this .requestedId = id;
29: if (requestedId == null) {
30: throw new IllegalArgumentException(
31: "attempt to create merge event with null identifier");
32: }
33: }
34:
35: public MergeEvent(Object object, EventSource source) {
36: super (source);
37: if (object == null) {
38: throw new IllegalArgumentException(
39: "attempt to create merge event with null entity");
40: }
41: this .original = object;
42: }
43:
44: public Object getOriginal() {
45: return original;
46: }
47:
48: public void setOriginal(Object object) {
49: this .original = object;
50: }
51:
52: public Serializable getRequestedId() {
53: return requestedId;
54: }
55:
56: public void setRequestedId(Serializable requestedId) {
57: this .requestedId = requestedId;
58: }
59:
60: public String getEntityName() {
61: return entityName;
62: }
63:
64: public void setEntityName(String entityName) {
65: this .entityName = entityName;
66: }
67:
68: public Object getEntity() {
69: return entity;
70: }
71:
72: public void setEntity(Object entity) {
73: this .entity = entity;
74: }
75:
76: public Object getResult() {
77: return result;
78: }
79:
80: public void setResult(Object result) {
81: this.result = result;
82: }
83: }
|