Java 类org.hibernate.CallbackException 实例源码

项目:cagrid-general    文件:GenericSecurityInterceptor.java   
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;
}
项目:common-security-module    文件:GenericSecurityInterceptor.java   
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;
}
项目:gitplex-mit    文件:HibernateInterceptor.java   
@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;
}
项目:gitplex-mit    文件:HibernateInterceptor.java   
@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;
}
项目:gitplex-mit    文件:HibernateInterceptor.java   
@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;
}
项目:finances    文件:InterceptorChain.java   
@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;
}
项目:finances    文件:InterceptorChain.java   
@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;
}
项目:helium    文件:AuditLogInterceptor.java   
public boolean onLoad (
        Object entity,
        Serializable id,
        Object[] state,
        String[] propertyNames,
        Type[] types) throws CallbackException {
    return false;
}
项目:helium    文件:AuditLogInterceptor.java   
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;
}
项目:helium    文件:AuditLogInterceptor.java   
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;
}
项目:helium    文件:AuditLogInterceptor.java   
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());
    }
}
项目:Audit4j-Hibernate    文件:AuditInterceptor.java   
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;
}
项目:springJpaKata    文件:LoggingInterceptor.java   
@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);
}
项目:cacheonix-core    文件:Fum.java   
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;
}
项目:cacheonix-core    文件:Fum.java   
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;
}
项目:cacheonix-core    文件:Qux.java   
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;
}
项目:cacheonix-core    文件:Qux.java   
public boolean onDelete(Session session) throws CallbackException {
    deleted=true;
    try {
        session.delete(foo);
    }
    catch (Exception e) {
        throw new CallbackException(e);
    }
    //if (child!=null) session.delete(child);
    return NO_VETO;
}
项目:cacheonix-core    文件:Foo.java   
public boolean onSave(Session db) throws CallbackException {
    _string = "a string";
    _date = new Date(123);
    _timestamp = new Date( System.currentTimeMillis() );
    _integer = new Integer( -666 );
    _long = new Long( 696969696969696969l - count++ );
    _short = new Short("42");
    _float = new Float( 6666.66f );
    //_double = new Double( 1.33e-69 );  // this double is too big for the sap db jdbc driver
    _double = new Double( 1.12e-36 );
    _boolean = new Boolean(true);
    _byte = new Byte( (byte) 127 );
    _int = 2;
    _char = '@';
    _bytes = _string.getBytes();
    Struct s = new Struct();
    s.name="name";
    s.count = 69;
    blob = s;
    binary = ( _string + "yada yada yada" ).getBytes();
    custom = new String[] { "foo", "bar" };
    component = new FooComponent("foo", 12, new Date[] { _date, _timestamp, null, new Date() }, new FooComponent("bar", 666, new Date[] { new Date(123456l), null }, null ) );
    component.setGlarch( new Glarch() );
    dependent = new Fee();
    dependent.setFi( "belongs to foo # " + getKey() );
    theLocale = Locale.getDefault();
    return NO_VETO;
}
项目:cacheonix-core    文件:Glarch.java   
public boolean onSave(Session s) throws CallbackException {
    dynaBean = new HashMap();
    dynaBean.put("foo", "foo");
    dynaBean.put("bar", new Integer(66));
    immutable="never changes!";
    return NO_VETO;
}
项目:cacheonix-core    文件:DocumentInterceptor.java   
public boolean onFlushDirty(
        Object entity, Serializable id,
        Object[] currentState, Object[] previousState,
        String[] propertyNames, Type[] types
) throws CallbackException {
    if ( entity instanceof Document ) {
        currentState[3] = Calendar.getInstance();
        return true;
    }
    else {
        return false;
    }
}
项目:cacheonix-core    文件:DocumentInterceptor.java   
public boolean onSave(
        Object entity, Serializable id, Object[] state,
        String[] propertyNames, Type[] types
) throws CallbackException {
    if ( entity instanceof Document ) {
        state[4] = state[3] = Calendar.getInstance();
        return true;
    }
    else {
        return false;
    }
}
项目:cacheonix-core    文件:DocumentInterceptor.java   
public boolean onFlushDirty(Object entity, Serializable id,
        Object[] currentState, Object[] previousState,
        String[] propertyNames, Type[] types) throws CallbackException {
    if ( entity instanceof Document ) {
        currentState[2] = Calendar.getInstance();
        return true;
    }
    else {
        return false;
    }
}
项目:cacheonix-core    文件:DocumentInterceptor.java   
public boolean onSave(Object entity, Serializable id, Object[] state,
        String[] propertyNames, Type[] types) throws CallbackException {
    if ( entity instanceof Document ) {
        state[3] = state[2] = Calendar.getInstance();
        return true;
    }
    else {
        return false;
    }
}
项目:owsi-core-parent    文件:TestEntityInterceptor.java   
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types)
        throws CallbackException {
    Map<String, Object> changes = Maps.newHashMap();
    changes.put("classicInterceptorSave", "interceptor");

    updatePropertyValues(changes, propertyNames, state);

    return true;
}
项目:owsi-core-parent    文件:TestEntityInterceptor.java   
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
        String[] propertyNames, Type[] types) throws CallbackException {
    Map<String, Object> changes = Maps.newHashMap();
    changes.put("classicInterceptorFlushDirty", "interceptor");

    updatePropertyValues(changes, propertyNames, currentState);

    return true;
}
项目:Hxms    文件:InitReactorStatsInterceptor.java   
@Override
public Object instantiate(String entityName, EntityMode entityMode,
        Serializable id) throws CallbackException {
    if (entityName
            .equals("net.sf.odinms.server.maps.MapleReactorStats$StateData")
            && entityMode.equals(entityMode.POJO)) {
        return new MapleReactorStats.StateData();
    }
    return null;
}
项目:Hxms    文件:InitPlayerInterceptor.java   
@Override
public Object instantiate(String entityName, EntityMode entityMode,
        Serializable id) throws CallbackException {
    if (entityName.equals("MainPlayer")
            && entityMode.equals(EntityMode.POJO) && id.equals(this.id)) {
        return new MapleCharacter(client, this.id);
    }
    return null;
}
项目:matsuo-core    文件:EntityInterceptorService.java   
@Override
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
  boolean modified = false;
  for (Interceptor interceptor : interceptors) {
    modified = interceptor.onLoad(entity, id, state, propertyNames, types) || modified;
  }
  return modified;
}
项目:matsuo-core    文件:EntityInterceptorService.java   
@Override
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException {
  boolean modified = false;
  for (Interceptor interceptor : interceptors) {
    modified = interceptor.onFlushDirty(entity, id, currentState, previousState, propertyNames, types) || modified;
  }
  return modified;
}
项目:matsuo-core    文件:EntityInterceptorService.java   
@Override
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
  boolean modified = false;
  for (Interceptor interceptor : interceptors) {
    modified = interceptor.onSave(entity, id, state, propertyNames, types) || modified;
  }
  return modified;
}
项目:gitplex-mit    文件:HibernateInterceptor.java   
@Override
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames,
        Type[] types) throws CallbackException {
    for (PersistListener listener: listeners)
        listener.onDelete(entity, id, state, propertyNames, types);
}
项目:gitplex-mit    文件:PersistListener.java   
boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws CallbackException;
项目:gitplex-mit    文件:PersistListener.java   
boolean onFlushDirty(Object entity, Serializable id, Object[] currentState,
Object[] previousState, String[] propertyNames, Type[] types) throws CallbackException;
项目:gitplex-mit    文件:PersistListener.java   
boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws CallbackException;
项目:gitplex-mit    文件:PersistListener.java   
void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws CallbackException;
项目:finances    文件:InterceptorChain.java   
@Override
public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
    for (Interceptor interceptor : chain) {
        interceptor.onDelete(entity, id, state, propertyNames, types);
    }
}
项目:openbravo-brazil    文件:JsonConversionTest.java   
@Override
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {
  fail();
}
项目:openbravo-brazil    文件:JsonConversionTest.java   
@Override
public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException {
  fail();
}
项目:openbravo-brazil    文件:JsonConversionTest.java   
@Override
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException {
  fail();
}
项目:openbravo-brazil    文件:ModelSessionFactoryController.java   
@Override
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException {
  Check.fail("The model session factory is not allowed to " + "update model data.");
}