Examples of buildMappings()


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

        catch (IOException e) {
            throw new IllegalArgumentException("Could not load configuration file '" + this.configuration + "'", e);
        }
       
        configuration.setProperty("hibernate.dialect", this.dialect);
        configuration.buildMappings();
       
        final Connection connection = DataSourceUtils.getConnection(this.dataSource);
        try {
            final SchemaExport exporter = new SchemaExport(configuration, connection);
            exporter.setFormat(false);
View Full Code Here

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

  @SuppressWarnings({ "unchecked" })
  public void testBuildingMetamodelWithParameterizedCollection() {
    AnnotationConfiguration cfg = new AnnotationConfiguration( );
    configure( cfg );
    cfg.addAnnotatedClass( WithGenericCollection.class );
    cfg.buildMappings();
    SessionFactoryImplementor sfi = (SessionFactoryImplementor) cfg.buildSessionFactory();
    MetamodelImpl.buildMetamodel( cfg.getClassMappings(), sfi );
  }

  public void testLogicalManyToOne() throws Exception {
View Full Code Here

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

      .addAnnotatedClass(multiPersonIdClass)
      .addAnnotatedClass(middleClass)
      .addAnnotatedClass(rightClass)
      .addAnnotatedClass(leftClass);
   
    configuration.buildMappings();
   
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    builder.applySettings(configuration.getProperties());
    new SchemaValidator(builder.build(), configuration).validate();
        } finally {
View Full Code Here

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

      Iterator<Table> iter = configuration.getTableMappings();
     
      //if no session-factory is build, the configuration is not fully initialized.
      //Hence, the ForeignKey's won't have a referenced table. This is calculated on
      //second pass.
      configuration.buildMappings();
     
     
      while (iter.hasNext()) {
        Table table = (Table) iter.next();
        if (table.isPhysicalTable()) {
View Full Code Here

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

  public void testAllInOne() {
    Configuration cfg = new Configuration();

    cfg.addResource( getBaseForMappings() + "extendshbm/allinone.hbm.xml" );
    cfg.buildMappings();
    assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Customer" ) );
    assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Person" ) );
    assertNotNull( cfg.getClassMapping( "org.hibernate.test.extendshbm.Employee" ) );
  }
View Full Code Here

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

          "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

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

    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

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

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

    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

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

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