Package org.hibernate.cfg

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


    }

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


          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
View Full Code Here

    Configuration cfg = new Configuration();

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

      cfg.buildMappings();

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

    }
View Full Code Here

  public void testEntityNamesWithPackageFailureExpected() {
    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

    //    <!ENTITY child SYSTEM "classpath://org/hibernate/test/util/dtd/child.xml">
    // which we are expecting the Hibernate custom entity resolver to be able to resolve
    // locally via classpath lookup.
    Configuration cfg = new Configuration();
    cfg.addResource( "org/hibernate/test/util/dtd/Parent.hbm.xml" );
    cfg.buildMappings();
  }
}
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

          "cannot be in the configuration yet!",
          cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" )
      );
      cfg.addResource( getBaseForMappings() + "extendshbm/Person.hbm.xml" );

      cfg.buildMappings();

      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
      assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
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

    Configuration cfg = new Configuration();

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

      cfg.buildMappings();

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

    }
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.