1 package org.hibernate.event; 3 4 import org.hibernate.LockMode; 5 6 11 public class RefreshEvent extends AbstractEvent { 12 13 private Object object; 14 private LockMode lockMode = LockMode.READ; 15 16 public RefreshEvent(Object object, EventSource source) { 17 super(source); 18 if (object == null) { 19 throw new IllegalArgumentException ("Attempt to generate refresh event with null object"); 20 } 21 this.object = object; 22 } 23 24 public RefreshEvent(Object object, LockMode lockMode, EventSource source) { 25 this(object, source); 26 if (lockMode == null) { 27 throw new IllegalArgumentException ("Attempt to generate refresh event with null lock mode"); 28 } 29 this.lockMode = lockMode; 30 } 31 32 public Object getObject() { 33 return object; 34 } 35 36 public LockMode getLockMode() { 37 return lockMode; 38 } 39 } 40 | Popular Tags |