Package org.hibernate

Examples of org.hibernate.Interceptor


                                    Object[] currentState,
                                    Object[] previousState,
                                    String[] propertyNames, Type[] types) {
        boolean result = false;
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            if (interceptor.onFlushDirty(entity, id, currentState, previousState, propertyNames, types)) {
                 /* Returns true if one interceptor in the chain has modified
                  * the object current state result = true;
                  */
                result = true;
             }
View Full Code Here


    @Override
    public boolean onSave(Object entity, Serializable id, Object[] state,
                                    String[] propertyNames, Type[] types) {
        boolean result = false;
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            if (interceptor.onSave(entity, id, state, propertyNames, types)) {
                /* Returns true if one interceptor in the chain has
                 * modified the object state result = true;
                 */
                result = true;
            }
View Full Code Here

     */
    @Override
    public void onDelete(Object entity, Serializable id, Object[] state,
                                    String[] propertyNames, Type[] types) {
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            interceptor.onDelete(entity, id, state, propertyNames, types);
        }
    }
View Full Code Here

                                    Object[] currentState,
                                    Object[] previousState,
                                    String[] propertyNames, Type[] types) {
        int[] result = null;
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            result =
                interceptor.findDirty(entity, id, currentState, previousState, propertyNames, types);
            if (result != null) {
                /* If any interceptor has returned something not null,
                 * stop the chain
                 */
                break;
View Full Code Here

     */
    @Override
    public void preFlush(Iterator entities) {
        List entityList = createList(entities);
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            interceptor.preFlush(entityList.iterator());
        }
    }
View Full Code Here

     */
    @Override
    public void postFlush(Iterator entities) {
        List entityList = createList(entities);
        for (Iterator iterator = _interceptors.iterator(); iterator.hasNext();) {
            Interceptor interceptor = (Interceptor) iterator.next();
            interceptor.postFlush(entityList.iterator());
        }
    }
View Full Code Here

      // Handle mappings....
      handleMappings( cfg );

      // Handle interceptor....
      Interceptor interceptorInstance = generateInterceptorInstance();
      if ( interceptorInstance != null )
      {
         cfg.setInterceptor( interceptorInstance );
      }
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

    Session session = null;

    try {
      if (txObject.getSessionHolder() == null || txObject.getSessionHolder().isSynchronizedWithTransaction()) {
        Interceptor entityInterceptor = getEntityInterceptor();
        Session newSession = (entityInterceptor != null ?
            getSessionFactory().openSession(entityInterceptor) : getSessionFactory().openSession());
        if (logger.isDebugEnabled()) {
          logger.debug("Opened new Session [" + SessionFactoryUtils.toString(newSession) +
              "] for Hibernate transaction");
View Full Code Here

    Session session = null;

    try {
      if (txObject.getSessionHolder() == null || txObject.getSessionHolder().isSynchronizedWithTransaction()) {
        Interceptor entityInterceptor = getEntityInterceptor();
        Session newSession = (entityInterceptor != null ?
            getSessionFactory().openSession(entityInterceptor) : getSessionFactory().openSession());
        if (logger.isDebugEnabled()) {
          logger.debug("Opened new Session [" + SessionFactoryUtils.toString(newSession) +
              "] for Hibernate transaction");
View Full Code Here

TOP

Related Classes of org.hibernate.Interceptor

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.