Package org.hibernate

Examples of org.hibernate.EmptyInterceptor


  public void testComponentInterceptor() {
    final int checkPerm = 500;
    final String checkComment = "generated from interceptor";

    Session s = openSession(
        new EmptyInterceptor() {
          public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) {
            if ( state[0] == null ) {
              Image.Details detail = new Image.Details();
              detail.setPerm1( checkPerm );
              detail.setComment( checkComment );
View Full Code Here


            // if (session.getInterceptor().onCollectionUpdate(coll, ce.getLoadedKey())) {
            //      actionQueue.addAction(...);
            // }
            //
            // This is really hacky. We should move to something better than Hibernate like EBEAN
            cfg.setInterceptor(new EmptyInterceptor() {

                @Override
                public int[] findDirty(Object o, Serializable id, Object[] arg2, Object[] arg3, String[] arg4, Type[] arg5) {
                    if (o instanceof JPABase && !((JPABase) o).willBeSaved) {
                        return new int[0];
View Full Code Here

TOP

Related Classes of org.hibernate.EmptyInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.