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

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

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

Configuration.getConfigurationInputStream介绍

[英]Get the configuration file as an InputStream. Might be overridden by subclasses to allow the configuration to be located by some arbitrary mechanism.

By default here we use classpath resource resolution
[中]以InputStream的形式获取配置文件。可能被子类覆盖,以允许通过某些任意机制定位配置。
这里默认使用类路径资源解析

代码示例

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

/**
 * Use the mappings and properties specified in the given application
 * resource. The format of the resource is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 * <p/>
 * The resource is found via <tt>getConfigurationInputStream(resource)</tt>.
 */
public Configuration configure(String resource) throws HibernateException {
  log.info( "configuring from resource: " + resource );
  InputStream stream = getConfigurationInputStream( resource );
  return doConfigure( stream, resource );
}

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

/**
 * Use the mappings and properties specified in the given application resource. The format of the resource is
 * defined in <tt>hibernate-configuration-3.0.dtd</tt>.
 * <p/>
 * The resource is found via {@link #getConfigurationInputStream}
 *
 * @param resource The resource to use
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates we cannot find the named resource
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(String resource) throws HibernateException {
  LOG.configuringFromResource( resource );
  InputStream stream = getConfigurationInputStream( resource );
  return doConfigure( stream, resource );
}

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

/**
 * Use the mappings and properties specified in the given application resource. The format of the resource is
 * defined in <tt>hibernate-configuration-3.0.dtd</tt>.
 * <p/>
 * The resource is found via {@link #getConfigurationInputStream}
 *
 * @param resource The resource to use
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates we cannot find the named resource
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(String resource) throws HibernateException {
  LOG.configuringFromResource( resource );
  InputStream stream = getConfigurationInputStream( resource );
  return doConfigure( stream, resource );
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

InputStream stream = getConfigurationInputStream( resource );
return doConfigure( stream, resource );

相关文章

Configuration类方法