Package org.hibernate.cfg

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


   
    public void testExporter() {
     
      Configuration configuration = new Configuration();
      addMappings( getMappings(), configuration );
      configuration.buildMappings();
   
      new HbmLintExporter(configuration, getOutputDir()).start();
     
    }
   
View Full Code Here


        Configuration cfg = new Configuration();
       
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "User2.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Group2.hbm.xml"));
       
        cfg.buildMappings();
       
    }
 
  public void testIdBagAttributes() {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + "User2.hbm.xml");
View Full Code Here

        Configuration cfg = new Configuration();

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Car.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "CarPart.hbm.xml"));
       
        cfg.buildMappings();
    }

  protected String getBaseForMappings() {
    return "org/hibernate/tool/hbm2x/hbm2hbmxml/";
  }
View Full Code Here

        Configuration cfg = new Configuration();

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Fee.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Glarch.hbm.xml"));

        cfg.buildMappings();
    }

  public void testClassProxy() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + "Glarch.hbm.xml");
    assertFileAndExists(outputXml);
View Full Code Here

        Configuration cfg = new Configuration();

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Fee.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Glarch.hbm.xml"));

        cfg.buildMappings();
    }

  public void testCompositeElementNode() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + "Glarch.hbm.xml");
    assertFileAndExists(outputXml);
View Full Code Here

        Configuration cfg = new Configuration();

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "User.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Group.hbm.xml"));

        cfg.buildMappings();

    }

  public void testManyToMany() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + "User.hbm.xml");
View Full Code Here

      .addFile( new File(getOutputDir(), "MultiPerson.hbm.xml"))
      .addFile( new File(getOutputDir(), "Middle.hbm.xml"))
      .addFile( new File(getOutputDir(), "Left.hbm.xml"))
      .addFile( new File(getOutputDir(), "Right.hbm.xml"));
   
    configuration.buildMappings();
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    builder.applySettings(configuration.getProperties());
    new SchemaValidator(builder.build(), configuration).validate();
    } finally {
      Thread.currentThread().setContextClassLoader(oldLoader);     
View Full Code Here

    Configuration configuration = new Configuration()
        .addFile( new File(getOutputDir(), "Employee.hbm.xml") )
        .addFile( new File(getOutputDir(), "Project.hbm.xml") )
      .addFile( new File(getOutputDir(), "WorksOnContext.hbm.xml") );
   
    configuration.buildMappings();
   
  }
 

  private void assertPropertyNotExist(PersistentClass projectClass, String prop) {
View Full Code Here

    Configuration configuration = new Configuration()
        .addFile( new File(getOutputDir(), "Role.hbm.xml") )
        .addFile( new File(getOutputDir(), "User.hbm.xml") )
        .addFile( new File(getOutputDir(), "Plainrole.hbm.xml"));
   
    configuration.buildMappings();
   
    assertMultiSchema(configuration);
  }
 
  protected void configure(JDBCMetaDataConfiguration configuration) {
View Full Code Here

        derived.addFile(new File(outputdir, "Product.hbm.xml") );
        derived.addFile(new File(outputdir, "Customer.hbm.xml") );
        derived.addFile(new File(outputdir, "Lineitem.hbm.xml") );
        derived.addFile(new File(outputdir, "Customerorder.hbm.xml") );
       
        derived.buildMappings();       
       
        /*assertNotNull(derived.getClassMapping("org.reveng.Child") );
        assertNotNull(derived.getClassMapping("org.reveng.Master") );*/
        URL[] urls = new URL[] { outputdir.toURL() };
        URLClassLoader ucl = new URLClassLoader(urls, Thread.currentThread().getContextClassLoader() );
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.