Package org.hibernate

Examples of org.hibernate.Interceptor


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

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

    if ( session == null ) {
      SessionBuilderImplementor sessionBuilder = internalGetEntityManagerFactory().getSessionFactory().withOptions();
      sessionBuilder.owner( this );
      if (sessionInterceptorClass != null) {
        try {
          Interceptor interceptor = (Interceptor) sessionInterceptorClass.newInstance();
          sessionBuilder.interceptor( interceptor );
        }
        catch (InstantiationException e) {
          throw new PersistenceException("Unable to instantiate session interceptor: " + sessionInterceptorClass, e);
        }
View Full Code Here

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


    Configuration defaultConf = new AnnotationConfiguration();
    Interceptor defaultInterceptor = defaultConf.getInterceptor();
    NamingStrategy defaultNamingStrategy = defaultConf.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();
      //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

    if ( session == null ) {
      SessionBuilderImplementor sessionBuilder = getEntityManagerFactory().getSessionFactory().withOptions();
      sessionBuilder.owner( this );
      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

    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();
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

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.