Package org.hibernate.cfg

Examples of org.hibernate.cfg.Configuration.buildMappings()


      String[] mappings = new String[]{"org/hibernate/test/cache/infinispan/functional/Item.hbm.xml"};
      for (String mapping : mappings) {
         cfg.addResource(mapping, Thread.currentThread().getContextClassLoader());
      }
      cfg.buildMappings();
      Iterator iter = cfg.getClassMappings();
      while (iter.hasNext()) {
         PersistentClass clazz = (PersistentClass) iter.next();
         cfg.setCacheConcurrencyStrategy(clazz.getEntityName(), "transactional");
      }
View Full Code Here


  protected Configuration buildConfiguration() {
    Configuration cfg = constructConfiguration();
    configure( cfg );
    addMappings( cfg );
    cfg.buildMappings();
    applyCacheSettings( cfg );
    afterConfigurationBuilt( cfg );
    return cfg;
  }
View Full Code Here

      }

      // Tell Hibernate to eagerly compile the mappings that we registered,
      // for availability of the mapping information in further processing.
      postProcessMappings(config);
      config.buildMappings();

      if (this.entityCacheStrategies != null) {
        // Register cache strategies for mapped entities.
        for (Enumeration<?> classNames = this.entityCacheStrategies.propertyNames(); classNames.hasMoreElements();) {
          String className = (String) classNames.nextElement();
View Full Code Here

    // make sure we use the same dialect...
    configuration.setProperty( Environment.DIALECT, getDialect().getClass().getName() );

    applyMappings( configuration );
    configuration.buildMappings();

    applyCacheSettings( configuration );
    settings.afterConfigurationBuilt( configuration.createMappings(), getDialect() );

    SessionFactory sessionFactory = configuration.buildSessionFactory();
View Full Code Here

      }

      // Tell Hibernate to eagerly compile the mappings that we registered,
      // for availability of the mapping information in further processing.
      postProcessMappings(config);
      config.buildMappings();

      if (this.entityCacheStrategies != null) {
        // Register cache strategies for mapped entities.
        for (Enumeration classNames = this.entityCacheStrategies.propertyNames(); classNames.hasMoreElements();) {
          String className = (String) classNames.nextElement();
View Full Code Here

  protected Configuration buildConfiguration() {
    Configuration cfg = constructConfiguration();
    configure( cfg );
    addMappings( cfg );
    cfg.buildMappings();
    applyCacheSettings( cfg );
    afterConfigurationBuilt( cfg );
    return cfg;
  }
View Full Code Here

  protected Configuration buildConfiguration() {
    Configuration cfg = constructConfiguration();
    configure( cfg );
    addMappings( cfg );
    cfg.buildMappings();
    applyCacheSettings( cfg );
    afterConfigurationBuilt( cfg );
    return cfg;
  }
View Full Code Here

    }

    // make sure we use the same dialect...
    configuration.setProperty( Environment.DIALECT, getDialect().getClass().getName() );

    configuration.buildMappings();
    settings.afterConfigurationBuilt( configuration.createMappings(), getDialect() );

    SessionFactory sessionFactory = configuration.buildSessionFactory();
    this.configuration = configuration;
    this.sessionFactory = sessionFactory;
View Full Code Here

      String[] mappings = new String[]{"org/hibernate/test/cache/infinispan/functional/Item.hbm.xml"};
      for (String mapping : mappings) {
         cfg.addResource(mapping, Thread.currentThread().getContextClassLoader());
      }
      cfg.buildMappings();
      Iterator iter = cfg.getClassMappings();
      while (iter.hasNext()) {
         PersistentClass clazz = (PersistentClass) iter.next();
         cfg.setCacheConcurrencyStrategy(clazz.getEntityName(), "transactional");
      }
View Full Code Here

    // make sure we use the same dialect...
    configuration.setProperty( Environment.DIALECT, getDialect().getClass().getName() );

    applyMappings( configuration );
    configuration.buildMappings();

    applyCacheSettings( configuration );
    settings.afterConfigurationBuilt( configuration.createMappings(), getDialect() );

    SessionFactory sessionFactory = configuration.buildSessionFactory();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.