Package org.hibernate

Examples of org.hibernate.EmptyInterceptor


    s.persist( u );
    t.commit();
    s.close();

    s = openSession(
        new EmptyInterceptor() {
          public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
            currentState[0] = "test";
            return true;
          }
        }
View Full Code Here


  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

    CollectionStatistics userGroupStats = sfi().getStatistics()
        .getCollectionStatistics( User.class.getName() + ".groups" );
    CollectionStatistics groupUserStats = sfi().getStatistics()
        .getCollectionStatistics( Group.class.getName() + ".users" );

    Interceptor testingInterceptor = new EmptyInterceptor() {
      public String onPrepareStatement(String sql) {
        // ugh, this is the best way I could come up with to assert this.
        // unfortunately, this is highly dependent on the dialect and its
        // outer join fragment.  But at least this wil fail on the majority
        // of dialects...
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

    CollectionStatistics userGroupStats = sfi().getStatistics()
        .getCollectionStatistics( User.class.getName() + ".groups" );
    CollectionStatistics groupUserStats = sfi().getStatistics()
        .getCollectionStatistics( Group.class.getName() + ".users" );

    Interceptor testingInterceptor = new EmptyInterceptor() {
      public String onPrepareStatement(String sql) {
        // ugh, this is the best way I could come up with to assert this.
        // unfortunately, this is highly dependent on the dialect and its
        // outer join fragment.  But at least this wil fail on the majority
        // of dialects...
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

            // 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

  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

    s.persist( u );
    t.commit();
    s.close();

    s = openSession(
        new EmptyInterceptor() {
          public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
            currentState[0] = "test";
            return true;
          }
        }
View Full Code Here

    s.persist( u );
    t.commit();
    s.close();

    s = openSession(
        new EmptyInterceptor() {
          public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
            currentState[0] = "test";
            return true;
          }
        }
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.