1 package org.hibernate.event; 3 4 import org.hibernate.ReplicationMode; 5 6 11 public class ReplicateEvent extends AbstractEvent { 12 13 private Object object; 14 private ReplicationMode replicationMode; 15 private String entityName; 16 17 public ReplicateEvent(Object object, ReplicationMode replicationMode, EventSource source) { 18 this(null, object, replicationMode, source); 19 } 20 21 public ReplicateEvent(String entityName, Object object, ReplicationMode replicationMode, EventSource source) { 22 super(source); 23 this.entityName = entityName; 24 25 if ( object == null ) { 26 throw new IllegalArgumentException ( 27 "attempt to create replication strategy with null entity" 28 ); 29 } 30 if ( replicationMode == null ) { 31 throw new IllegalArgumentException ( 32 "attempt to create replication strategy with null replication mode" 33 ); 34 } 35 36 this.object = object; 37 this.replicationMode = replicationMode; 38 } 39 40 public Object getObject() { 41 return object; 42 } 43 44 public void setObject(Object object) { 45 this.object = object; 46 } 47 48 public ReplicationMode getReplicationMode() { 49 return replicationMode; 50 } 51 52 public void setReplicationMode(ReplicationMode replicationMode) { 53 this.replicationMode = replicationMode; 54 } 55 56 public String getEntityName() { 57 return entityName; 58 } 59 public void setEntityName(String entityName) { 60 this.entityName = entityName; 61 } 62 } 63 | Popular Tags |