vetoer.java
来自「用Java实现的23个常用设计模式源代码」· Java 代码 · 共 62 行
JAVA
62 行
//$Id: Vetoer.java,v 1.1.2.1 2003/11/08 02:25:30 oneovthafew Exp $package org.hibernate.test;import java.io.Serializable;import net.sf.hibernate.CallbackException;import net.sf.hibernate.Lifecycle;import net.sf.hibernate.Session;public class Vetoer implements Lifecycle { boolean onSaveCalled; boolean onUpdateCalled; boolean onDeleteCalled; private String name; private String[] strings; public boolean onSave(Session s) throws CallbackException { boolean result = !onSaveCalled; onSaveCalled = true; return result; } public boolean onUpdate(Session s) throws CallbackException { boolean result = !onUpdateCalled; onUpdateCalled = true; return result; } public boolean onDelete(Session s) throws CallbackException { boolean result = !onDeleteCalled; onDeleteCalled = true; return result; } public void onLoad(Session s, Serializable id) {} public String getName() { return name; } public void setName(String name) { this.name = name; } public String[] getStrings() { return strings; } public void setStrings(String[] strings) { this.strings = strings; } }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?