Package org.hibernate.cfg

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


      this.url = url;
    }
    public void apply(Object target, WireContext wireContext) {
      Configuration configuration = (Configuration) target;
      try {
        configuration.addURL(new URL(url));
      } catch (Exception e) {
        throw new PvmException("couldn't add hibernate mapping from URL "+url, e);
      }
    }
  }
View Full Code Here


        URL url = Thread.currentThread().getContextClassLoader().getResource(config_path);
        if (url == null) {
            log.error("hibernate config file not found: {}", config_path);
        } else {
            log.info("adding hibernate config file {}", config_path);
            conf_.addURL(url);
        }

        sessionFactory_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<SessionFactory>() {
            public SessionFactory run() {
                SessionFactory factory = conf_.configure().buildSessionFactory();
View Full Code Here

      assertEquals( inv.getType(), "resource" );
      assertEquals( inv.getPath(), "nothere" );
    }

    try {
      cfg.addURL( new URL( "file://nothere" ) );
      fail();
    }
    catch ( InvalidMappingException inv ) {
      assertEquals( inv.getType(), "URL" );
      assertEquals( inv.getPath(), "file://nothere" );
View Full Code Here

      assertEquals( inv.getPath(), resourceName );
      assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
    }

    try {
      cfg.addURL( ConfigHelper.findAsResource( resourceName ) );
      fail();
    }
    catch ( InvalidMappingException inv ) {
      assertEquals( inv.getType(), "URL" );
      assertTrue( inv.getPath().endsWith( "InvalidMapping.hbm.xml" ) );
View Full Code Here

      this.url = url;
    }
    public void apply(Object target, WireContext wireContext) {
      Configuration configuration = (Configuration) target;
      try {
        configuration.addURL(new URL(url));
      } catch (Exception e) {
        throw new JbpmException("couldn't add hibernate mapping from URL "+url, e);
      }
    }
  }
View Full Code Here

      this.url = url;
    }
    public void apply(Object target, WireContext wireContext) {
      Configuration configuration = (Configuration) target;
      try {
        configuration.addURL(new URL(url));
      } catch (Exception e) {
        throw new JbpmException("couldn't add hibernate mapping from URL "+url, e);
      }
    }
  }
View Full Code Here

      assertEquals( inv.getType(), "resource" );
      assertEquals( inv.getPath(), "nothere" );
    }

    try {
      cfg.addURL( new URL( "file://nothere" ) );
      fail();
    }
    catch ( InvalidMappingException inv ) {
      assertEquals( inv.getType(), "URL" );
      assertEquals( inv.getPath(), "file://nothere" );
View Full Code Here

      assertEquals( inv.getPath(), resourceName );
      assertTrue( !( inv.getCause() instanceof MappingNotFoundException ) );
    }

    try {
      cfg.addURL( ConfigHelper.findAsResource( resourceName ) );
      fail();
    }
    catch ( InvalidMappingException inv ) {
      assertEquals( inv.getType(), "URL" );
      assertTrue( inv.getPath().endsWith( "InvalidMapping.hbm.xml" ) );
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.