1 package org.hibernate.test.legacy; 3 4 import java.io.Serializable ; 5 6 import org.hibernate.CallbackException; 7 import org.hibernate.Session; 8 import org.hibernate.classic.Lifecycle; 9 10 public class Vetoer implements Lifecycle { 11 12 boolean onSaveCalled; 13 boolean onUpdateCalled; 14 boolean onDeleteCalled; 15 16 private String name; 17 private String [] strings; 18 19 public boolean onSave(Session s) throws CallbackException { 20 boolean result = !onSaveCalled; 21 onSaveCalled = true; 22 return result; 23 } 24 25 public boolean onUpdate(Session s) throws CallbackException { 26 boolean result = !onUpdateCalled; 27 onUpdateCalled = true; 28 return result; 29 } 30 31 public boolean onDelete(Session s) throws CallbackException { 32 boolean result = !onDeleteCalled; 33 onDeleteCalled = true; 34 return result; 35 } 36 37 public void onLoad(Session s, Serializable id) {} 38 39 public String getName() { 40 return name; 41 } 42 43 public void setName(String name) { 44 this.name = name; 45 } 46 47 public String [] getStrings() { 48 return strings; 49 } 50 51 public void setStrings(String [] strings) { 52 this.strings = strings; 53 } 54 55 } 56 57 58 59 60 61 62 | Popular Tags |