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() );

    applyMappings( configuration );
    configuration.buildMappings();

    applyCacheSettings( configuration );
    settings.afterConfigurationBuilt( configuration.createMappings(), getDialect() );

    this.configuration = configuration;
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

      }

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

    }

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

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

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + mappingFile));

        cfg.buildMappings();
    }

  public void testKey() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + mappingFile);
    assertFileAndExists(outputXml);
View Full Code Here

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "ComplexPropertyValue.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "IntegerPropertyValue.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "StringPropertyValue.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "PropertySet.hbm.xml"));

        cfg.buildMappings();
    }

  public void testAnyNode() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + "PropertySet.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 testListNode() 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() + "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

  }

  public void testReadable() {
        Configuration cfg = new Configuration();
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Order.hbm.xml"));
        cfg.buildMappings();
    }

  public void testTypeParamsElements() throws DocumentException {
    File outputXml = new File(getOutputDir(),  getBaseForMappings() + mappingFile);
    assertFileAndExists(outputXml);
View Full Code Here

        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Alien.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Human.hbm.xml"));
        cfg.addFile(new File(getOutputDir(), getBaseForMappings() + "Animal.hbm.xml"));

        cfg.buildMappings();
    }

  public void testComment() {
    File outputXml = new File(getOutputDir().getAbsolutePath() + "/org/hibernate/tool/hbm2x/hbm2hbmxml/Alien.hbm.xml");
    assertFileAndExists(outputXml);
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.