org.hibernate.cfg.Configuration.addURL()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.hibernate.cfg.Configuration.addURL()方法的一些代码示例,展示了Configuration.addURL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.addURL()方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:addURL

Configuration.addURL介绍

[英]Read mappings from a URL
[中]从URL读取映射

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Test
@TestForIssue(jiraKey = "HHH-9247")
public void parseNamedAttributeNode() {
  final Configuration cfg = new Configuration();
  cfg.addURL( ConfigHelper.findAsResource( "org/hibernate/test/annotations/entityGraph/orm.xml" ) );
  cfg.buildMappings();
}

代码示例来源:origin: org.hibernate/hibernate-annotations

@Override
public AnnotationConfiguration addURL(URL url) throws MappingException {
  super.addURL( url );
  return this;
}

代码示例来源:origin: hibernate/hibernate-orm

cfg.addURL( ConfigHelper.findAsResource( resourceName ) );
fail();

代码示例来源:origin: hibernate/hibernate-orm

cfg.addURL( new URL( "file://nothere" ) );
fail();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

@Override
public AnnotationConfiguration addURL(URL url) throws MappingException {
  super.addURL( url );
  return this;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

@Override
public AnnotationConfiguration addURL(URL url) throws MappingException {
  super.addURL( url );
  return this;
}

代码示例来源:origin: babyfish-ct/babyfish

@Override
public Configuration addURL(URL url) throws MappingException {
  super.addURL(url);
  return this;
}

代码示例来源:origin: org.ow2.bonita/bonita-pvm

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

代码示例来源:origin: org.jbpm/pvm

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

代码示例来源:origin: org.ow2.bonita/bonita-server

@Override
 public void apply(final Object target, final WireContext wireContext) {
  final Configuration configuration = (Configuration) target;
  try {
   configuration.addURL(new URL(url));
  } catch (final Exception e) {
   final String message = ExceptionManager.getInstance().getFullMessage("bp_HCD_3", url);
   throw new BonitaRuntimeException(message, e);
  }
 }
}

代码示例来源:origin: es.ucm.fdi.gaia/jCOLIBRI

hbconfig.addURL(FileIO.findFile(descriptionMapFile));

代码示例来源:origin: 52North/SOS

List<String> resources = (List<String>) properties.get(HIBERNATE_RESOURCES);
for (String resource : resources) {
  configuration.addURL(SessionFactoryProvider.class.getResource(resource));

代码示例来源:origin: org.n52.sensorweb.sos/hibernate-session-factory

List<String> resources = (List<String>) properties.get(HIBERNATE_RESOURCES);
for (String resource : resources) {
  configuration.addURL(SessionFactoryProvider.class.getResource(resource));

代码示例来源:origin: org.gatein.portal/exo.portal.component.identity

private void setupHibernate(Properties config) throws Exception {
  final Configuration conf_ = new Configuration();
  conf_.setProperty("hibernate.connection.driver_class", config.getProperty("hibernate.connection.driver_class"));
  conf_.setProperty("hibernate.connection.url", config.getProperty("hibernate.connection.url"));
  conf_.setProperty("hibernate.connection.username", config.getProperty("hibernate.connection.username"));
  conf_.setProperty("hibernate.connection.password", config.getProperty("hibernate.connection.password"));
  conf_.setProperty("hibernate.dialect", config.getProperty("hibernate.dialect"));
  String config_path = config.getProperty("hibernate.config_path");
  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();
      return factory;
    }
  });
}

代码示例来源:origin: de.tudarmstadt.ukp.uby/de.tudarmstadt.ukp.uby.lmf.api-asl

.getResources("hibernatemap/access/**/*.hbm.xml");
for (Resource mapping : mappings) {
  cfg.addURL(mapping.getURL());

相关文章

Configuration类方法