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();
View Full Code Here

  public static void registerInterceptor( final Interceptor interceptor ) {
    HibernateUtil.threadInterceptor.set( interceptor );
  }

  private static Interceptor getInterceptor() {
    Interceptor interceptor = (Interceptor) HibernateUtil.threadInterceptor.get();
    return interceptor;
  }
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

  }

  @Override
    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();
      //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

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

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.