saveorupdateevent.java
来自「介绍了hibernate的入门有一些基本常用的事例」· Java 代码 · 共 87 行
JAVA
87 行
//$Id: SaveOrUpdateEvent.java,v 1.8 2005/02/22 03:09:32 oneovthafew Exp $package org.hibernate.event;import java.io.Serializable;import org.hibernate.engine.EntityEntry;import org.hibernate.engine.SessionImplementor;/** * An event class for saveOrUpdate() * * @author Steve Ebersole */public class SaveOrUpdateEvent extends AbstractEvent { private Object object; private Serializable requestedId; private String entityName; private Object entity; private EntityEntry entry; public SaveOrUpdateEvent(String entityName, Object original, SessionImplementor source) { this(original, source); this.entityName = entityName; } public SaveOrUpdateEvent(String entityName, Object original, Serializable id, SessionImplementor source) { this(entityName, original, source); this.requestedId = id; if ( requestedId == null ) { throw new IllegalArgumentException( "attempt to create saveOrUpdate event with null identifier" ); } } public SaveOrUpdateEvent(Object object, SessionImplementor source) { super(source); if ( object == null ) { throw new IllegalArgumentException( "attempt to create saveOrUpdate event with null entity" ); } this.object = object; } public Object getObject() { return object; } public void setObject(Object object) { this.object = object; } public Serializable getRequestedId() { return requestedId; } public void setRequestedId(Serializable requestedId) { this.requestedId = requestedId; } public String getEntityName() { return entityName; } public void setEntityName(String entityName) { this.entityName = entityName; } public Object getEntity() { return entity; } public void setEntity(Object entity) { this.entity = entity; } public EntityEntry getEntry() { return entry; } public void setEntry(EntityEntry entry) { this.entry = entry; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?