Examples of buildMappings()


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

  public void testDuplicateMapping() {
    String resourceName = "org/hibernate/test/mappingexception/User.hbm.xml";
    Configuration cfg = new Configuration();
    cfg.addResource( resourceName );
    cfg.buildMappings();
    try {
      cfg.addResource( resourceName );
      cfg.buildMappings();
      fail();
    }
View Full Code Here

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

    Configuration cfg = new Configuration();
    cfg.addResource( resourceName );
    cfg.buildMappings();
    try {
      cfg.addResource( resourceName );
      cfg.buildMappings();
      fail();
    }
    catch ( InvalidMappingException inv ) {
      assertEquals( inv.getType(), "resource" );
      assertEquals( inv.getPath(), resourceName );
View Full Code Here

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

      cfg.setProperty(Environment.CACHE_REGION_FACTORY, "org.hibernate.cache.infinispan.InfinispanRegionFactory");
      String[] mappings = new String[]{"org/hibernate/test/cache/infinispan/functional/Item.hbm.xml"};
      for (String mapping : mappings) {
         cfg.addResource(mapping, Thread.currentThread().getContextClassLoader());
      }
      cfg.buildMappings();
      Iterator iter = cfg.getClassMappings();
      while (iter.hasNext()) {
         PersistentClass clazz = (PersistentClass) iter.next();
         cfg.setCacheConcurrencyStrategy(clazz.getEntityName(), "transactional");
      }
View Full Code Here

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

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

      }

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

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

      }

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

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

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

  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

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

        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

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

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