2
* Hibernate, Relational Persistence for Idiomatic Java
4
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
5
* indicated by the @author tags or express copyright attribution
6
* statements applied by the authors. All third-party contributions are
7
* distributed under license by Red Hat Middleware LLC.
9
* This copyrighted material is made available to anyone wishing to use, modify,
10
* copy, or redistribute it subject to the terms and conditions of the GNU
11
* Lesser General Public License, as published by the Free Software Foundation.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
18
* You should have received a copy of the GNU Lesser General Public License
19
* along with this distribution; if not, write to:
20
* Free Software Foundation, Inc.
21
* 51 Franklin Street, Fifth Floor
22
* Boston, MA 02110-1301 USA
25
package org.hibernate.event;
27
import java.io.Serializable;
30
* An event class for merge() and saveOrUpdateCopy()
34
public class MergeEvent extends AbstractEvent {
36
private Object original;
37
private Serializable requestedId;
38
private String entityName;
39
private Object entity;
40
private Object result;
42
public MergeEvent(String entityName, Object original, EventSource source) {
43
this(original, source);
44
this.entityName = entityName;
47
public MergeEvent(String entityName, Object original, Serializable id, EventSource source) {
48
this(entityName, original, source);
49
this.requestedId = id;
50
if ( requestedId == null ) {
51
throw new IllegalArgumentException(
52
"attempt to create merge event with null identifier"
57
public MergeEvent(Object object, EventSource source) {
59
if ( object == null ) {
60
throw new IllegalArgumentException(
61
"attempt to create merge event with null entity"
64
this.original = object;
67
public Object getOriginal() {
71
public void setOriginal(Object object) {
72
this.original = object;
75
public Serializable getRequestedId() {
79
public void setRequestedId(Serializable requestedId) {
80
this.requestedId = requestedId;
83
public String getEntityName() {
87
public void setEntityName(String entityName) {
88
this.entityName = entityName;
91
public Object getEntity() {
94
public void setEntity(Object entity) {
98
public Object getResult() {
102
public void setResult(Object result) {
103
this.result = result;