Package org.hibernate.cfg

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


  public void testEntityNamesWithPackage() {
    Configuration cfg = new Configuration();
    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/packageentitynames.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "EntityHasName" ) );
      assertNotNull( cfg.getClassMapping( "EntityCompany" ) );

    }
View Full Code Here


    Configuration cfg = new Configuration();

    try {
      cfg.addResource( getBaseForMappings() + "extendshbm/unionsubclass.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );

    }
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

        EntityManagerFactoryBuilderImpl builder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(persistenceUnitInfo,
                jpaPropertyMap, null);
        ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
        Configuration configuration = builder.buildHibernateConfiguration(serviceRegistry);
        configuration.buildMappings();
        AuditConfiguration.getFor(configuration);
        return configuration;
    }

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