本文整理汇总了Java中org.hibernate.CallbackException类的典型用法代码示例。如果您正苦于以下问题:Java CallbackException类的具体用法?Java CallbackException怎么用?Java CallbackException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CallbackException类属于org.hibernate包,在下文中一共展示了CallbackException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previuosState,String[] propertyNames, Type[] types) throws CallbackException {
boolean bool = Boolean.FALSE;
if(null!=interceptors && !interceptors.isEmpty()){
Iterator it = interceptors.iterator();
while(it.hasNext()){
Interceptor interceptor = (Interceptor) it.next();
boolean temp=false;
if(interceptor!=null){
temp= interceptor.onFlushDirty(entity, id, currentState, previuosState, propertyNames, types);
if(temp) bool = true;
}
}
}
return bool;
}
示例2: onLoad
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws CallbackException {
boolean changed = false;
for (PersistListener listener: listeners) {
if (listener.onLoad(entity, id, state, propertyNames, types))
changed = true;
}
return changed;
}
示例3: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState,
Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException {
boolean changed = false;
for (PersistListener listener: listeners) {
if (listener.onFlushDirty(entity, id, currentState, previousState, propertyNames, types))
changed = true;
}
return changed;
}
示例4: onSave
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws CallbackException {
boolean changed = false;
for (PersistListener listener: listeners) {
if (listener.onSave(entity, id, state, propertyNames, types))
changed = true;
}
return changed;
}
示例5: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) throws CallbackException {
boolean modified = false;
for (Interceptor interceptor : chain) {
modified |= interceptor.onFlushDirty(entity, id, currentState, previousState, propertyNames, types);
}
return modified;
}
示例6: onSave
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
boolean modified = false;
for (Interceptor interceptor : chain) {
modified |= interceptor.onSave(entity, id, state, propertyNames, types);
}
return modified;
}
示例7: onLoad
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onLoad (
Object entity,
Serializable id,
Object[] state,
String[] propertyNames,
Type[] types) throws CallbackException {
return false;
}
示例8: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onFlushDirty(Object entity, Serializable id, Object[] newValues, Object[] oldValues, String[] propertyNames, Type[] types) throws CallbackException {
if (entity instanceof Auditable) {
getActionLogger().createLog(
"update",
entity,
propertyNames,
getUserId());
}
return false;
}
示例9: onSave
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
if (entity instanceof Auditable) {
getActionLogger().createLog(
"create",
entity,
propertyNames,
getUserId());
}
return false;
}
示例10: onDelete
import org.hibernate.CallbackException; //导入依赖的package包/类
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
if (entity instanceof Auditable) {
getActionLogger().createLog(
"delete",
entity,
propertyNames,
getUserId());
}
}
示例11: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState,
Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException {
if (entity.getClass().isAnnotationPresent(Audit.class)) {
updates.add(entity);
}
return false;
}
示例12: onFlushDirty
import org.hibernate.CallbackException; //导入依赖的package包/类
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException {
log.info( "Entity {0}#{1} changed from {2} to {3}",
entity.getClass().getSimpleName(),
id,
Arrays.toString( previousState ),
Arrays.toString( currentState )
);
return super.onFlushDirty(entity,id,currentState,previousState,propertyNames,types);
}
示例13: onDelete
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onDelete(Session s) throws CallbackException {
if (friends==null) return false;
try {
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
s.delete( iter.next() );
}
}
catch (Exception e) {
throw new CallbackException(e);
}
return false;
}
示例14: onSave
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onSave(Session s) throws CallbackException {
if (friends==null) return false;
try {
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
s.save( iter.next() );
}
}
catch (Exception e) {
throw new CallbackException(e);
}
return false;
}
示例15: onSave
import org.hibernate.CallbackException; //导入依赖的package包/类
public boolean onSave(Session session) throws CallbackException {
created=true;
try {
foo = new Foo();
session.save(foo);
}
catch (Exception e) {
throw new CallbackException(e);
}
foo.setString("child of a qux");
return NO_VETO;
}