Package org.hibernate.cfg

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


  @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

      .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

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.