Package org.hibernate

Examples of org.hibernate.Interceptor


    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
      //had to be safe
      if ( uncastObject != null && uncastObject instanceof String ) {
        String propertyKey = (String) uncastObject;
        if ( propertyKey.startsWith( AvailableSettings.CLASS_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, true, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.COLLECTION_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, false, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.JACC_PREFIX )
            && ! ( propertyKey.equals( AvailableSettings.JACC_CONTEXT_ID )
            || propertyKey.equals( AvailableSettings.JACC_ENABLED ) ) ) {
          jaccKeys.add( propertyKey );
        }
      }
    }
    final Interceptor interceptor = instantiateCustomClassFromConfiguration(
        preparedProperties,
        defaultInterceptor,
        cfg.getInterceptor(),
        AvailableSettings.INTERCEPTOR,
        "interceptor",
View Full Code Here


    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
      //had to be safe
      if ( uncastObject != null && uncastObject instanceof String ) {
        String propertyKey = (String) uncastObject;
        if ( propertyKey.startsWith( AvailableSettings.CLASS_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, true, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.COLLECTION_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, false, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.JACC_PREFIX )
            && ! ( propertyKey.equals( AvailableSettings.JACC_CONTEXT_ID )
            || propertyKey.equals( AvailableSettings.JACC_ENABLED ) ) ) {
          jaccKeys.add( propertyKey );
        }
      }
    }
    final Interceptor interceptor = instantiateCustomClassFromConfiguration(
        preparedProperties,
        defaultInterceptor,
        cfg.getInterceptor(),
        AvailableSettings.INTERCEPTOR,
        "interceptor",
View Full Code Here

    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
View Full Code Here

    return getRawSession();
  }

  protected Session getRawSession() {
    if ( session == null ) {
      Interceptor interceptor = null;
      if (sessionInterceptorClass != null) {
        try {
          interceptor = (Interceptor) sessionInterceptorClass.newInstance();
        }
        catch (InstantiationException e) {
View Full Code Here

    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
View Full Code Here

    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
View Full Code Here

    protected Session getRawSession() {
    if ( session == null ) {
      SessionBuilder sessionBuilder = getEntityManagerFactory().getSessionFactory().withOptions();
      if (sessionInterceptorClass != null) {
        try {
          Interceptor interceptor = (Interceptor) sessionInterceptorClass.newInstance();
          sessionBuilder.interceptor( interceptor );
        }
        catch (InstantiationException e) {
          throw new PersistenceException("Unable to instanciate session interceptor: " + sessionInterceptorClass, e);
        }
View Full Code Here

    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
      //had to be safe
      if ( uncastObject != null && uncastObject instanceof String ) {
        String propertyKey = (String) uncastObject;
        if ( propertyKey.startsWith( AvailableSettings.CLASS_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, true, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.COLLECTION_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, false, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.JACC_PREFIX )
            && ! ( propertyKey.equals( AvailableSettings.JACC_CONTEXT_ID )
            || propertyKey.equals( AvailableSettings.JACC_ENABLED ) ) ) {
          jaccKeys.add( propertyKey );
        }
      }
    }
    final Interceptor interceptor = instantiateCustomClassFromConfiguration(
        preparedProperties,
        defaultInterceptor,
        cfg.getInterceptor(),
        AvailableSettings.INTERCEPTOR,
        "interceptor",
View Full Code Here

    //processes specific properties
    List<String> jaccKeys = new ArrayList<String>();


    Interceptor defaultInterceptor = DEFAULT_CONFIGURATION.getInterceptor();
    NamingStrategy defaultNamingStrategy = DEFAULT_CONFIGURATION.getNamingStrategy();

    Iterator propertyIt = preparedProperties.keySet().iterator();
    while ( propertyIt.hasNext() ) {
      Object uncastObject = propertyIt.next();
      //had to be safe
      if ( uncastObject != null && uncastObject instanceof String ) {
        String propertyKey = (String) uncastObject;
        if ( propertyKey.startsWith( AvailableSettings.CLASS_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, true, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.COLLECTION_CACHE_PREFIX ) ) {
          setCacheStrategy( propertyKey, preparedProperties, false, workingVars );
        }
        else if ( propertyKey.startsWith( AvailableSettings.JACC_PREFIX )
            && ! ( propertyKey.equals( AvailableSettings.JACC_CONTEXT_ID )
            || propertyKey.equals( AvailableSettings.JACC_ENABLED ) ) ) {
          jaccKeys.add( propertyKey );
        }
      }
    }
    final Interceptor interceptor = instantiateCustomClassFromConfiguration(
        preparedProperties,
        defaultInterceptor,
        cfg.getInterceptor(),
        AvailableSettings.INTERCEPTOR,
        "interceptor",
View Full Code Here

        // Hibernate properties
        factoryBean.setHibernateProperties(hibernateProperties());
        factoryBean.setDataSource(dataSource());

        Interceptor interceptor = hibernateInterceptor();
        if (interceptor != null)
            factoryBean.setEntityInterceptor(hibernateInterceptor());

        setupSessionFactory(factoryBean);
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.