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

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

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

Configuration.doConfigure介绍

[英]Configure this configuration's state from the contents of the given input stream. The expectation is that the stream contents represent an XML document conforming to the Hibernate Configuration DTD. See #doConfigure(Document) for further details.
[中]根据给定输入流的内容配置此配置的状态。期望流内容表示符合Hibernate配置DTD的XML文档。有关更多详细信息,请参见#文档配置(文档)。

代码示例

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

@Override
protected AnnotationConfiguration doConfigure(InputStream stream, String resourceName) throws HibernateException {
  super.doConfigure( stream, resourceName );
  return this;
}

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

@Override
protected AnnotationConfiguration doConfigure(Document doc) throws HibernateException {
  super.doConfigure( doc );
  return this;
}

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

@Override
protected AnnotationConfiguration doConfigure(Document doc) throws HibernateException {
  super.doConfigure( doc );
  return this;
}

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

@Override
protected AnnotationConfiguration doConfigure(Document doc) throws HibernateException {
  super.doConfigure( doc );
  return this;
}

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

@Override
protected AnnotationConfiguration doConfigure(InputStream stream, String resourceName) throws HibernateException {
  super.doConfigure( stream, resourceName );
  return this;
}

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

@Override
protected AnnotationConfiguration doConfigure(InputStream stream, String resourceName) throws HibernateException {
  super.doConfigure( stream, resourceName );
  return this;
}

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

/**
 * Use the mappings and properties specified in the given document.
 * The format of the document is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param url URL from which you wish to load the configuration
 * @return A configuration configured via the file
 * @throws HibernateException
 */
public Configuration configure(URL url) throws HibernateException {
  log.info( "configuring from url: " + url.toString() );
  try {
    return doConfigure( url.openStream(), url.toString() );
  }
  catch (IOException ioe) {
    throw new HibernateException( "could not configure from URL: " + url, ioe );
  }
}

代码示例来源: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: hibernate/hibernate

/**
 * Use the mappings and properties specified in the given document.
 * The format of the document is defined in
 * <tt>hibernate-configuration-2.2.dtd</tt>.
 *
 * @param url URL from which you wish to load the configuration
 * @return A configuration configured via the file
 * @throws HibernateException
 */
public Configuration configure(URL url) throws HibernateException {
  log.info( "configuring from url: " + url.toString() );
  try {
    return doConfigure( url.openStream(), url.toString() );
  }
  catch ( IOException ioe ) {
    throw new HibernateException( "could not configure from URL: " + url, ioe );
  }
}

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

/**
 * Use the mappings and properties specified in the given application
 * file. The format of the file is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param configFile <tt>File</tt> from which you wish to load the configuration
 * @return A configuration configured via the file
 * @throws HibernateException
 */
public Configuration configure(File configFile) throws HibernateException {
  log.info( "configuring from file: " + configFile.getName() );
  try {
    return doConfigure( new FileInputStream( configFile ), configFile.toString() );
  }
  catch ( FileNotFoundException fnfe ) {
    throw new HibernateException( "could not find file: " + configFile, fnfe );
  }
}

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

/**
 * Use the mappings and properties specified in the given application file. The format of the file is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param configFile File from which you wish to load the configuration
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates a problem access the file
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(File configFile) throws HibernateException {
  LOG.configuringFromFile( configFile.getName() );
  try {
    return doConfigure( new FileInputStream( configFile ), configFile.toString() );
  }
  catch (FileNotFoundException fnfe) {
    throw new HibernateException( "could not find file: " + configFile, fnfe );
  }
}

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

/**
 * Use the mappings and properties specified in the given application file. The format of the file is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param configFile File from which you wish to load the configuration
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates a problem access the file
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(File configFile) throws HibernateException {
  LOG.configuringFromFile( configFile.getName() );
  try {
    return doConfigure( new FileInputStream( configFile ), configFile.toString() );
  }
  catch (FileNotFoundException fnfe) {
    throw new HibernateException( "could not find file: " + configFile, fnfe );
  }
}

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

/**
 * Use the mappings and properties specified in the given document. The format of the document is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param url URL from which you wish to load the configuration
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates a problem access the url
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(URL url) throws HibernateException {
  LOG.configuringFromUrl( url );
  try {
    return doConfigure( url.openStream(), url.toString() );
  }
  catch (IOException ioe) {
    throw new HibernateException( "could not configure from URL: " + url, ioe );
  }
}

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

/**
 * Use the mappings and properties specified in the given document. The format of the document is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param url URL from which you wish to load the configuration
 *
 * @return this for method chaining
 *
 * @throws HibernateException Generally indicates a problem access the url
 *
 * @see #doConfigure(java.io.InputStream, String)
 */
public Configuration configure(URL url) throws HibernateException {
  LOG.configuringFromUrl( url );
  try {
    return doConfigure( url.openStream(), url.toString() );
  }
  catch (IOException ioe) {
    throw new HibernateException( "could not configure from URL: " + url, ioe );
  }
}

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

return doConfigure( doc );

代码示例来源: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: hibernate/hibernate

/**
 * Use the mappings and properties specified in the given XML document.
 * The format of the file is defined in
 * <tt>hibernate-configuration-2.2.dtd</tt>.
 *
 * @param document an XML document from which you wish to load the configuration
 * @return A configuration configured via the <tt>Document</tt>
 * @throws HibernateException if there is problem in accessing the file.
 */
public Configuration configure(Document document) throws HibernateException {
  log.info( "configuring from XML document" );
  org.dom4j.Document doc;
  try {
    doc = xmlHelper.createDOMReader().read( document );
  }
  catch ( Exception e ) {
    log.error( "problem parsing document", e );
    throw new HibernateException( "problem parsing document", e );
  }
  return doConfigure( doc );
}

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

/**
 * Use the mappings and properties specified in the given XML document.
 * The format of the file is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param document an XML document from which you wish to load the configuration
 * @return A configuration configured via the <tt>Document</tt>
 * @throws HibernateException if there is problem in accessing the file.
 */
public Configuration configure(org.w3c.dom.Document document) throws HibernateException {
  LOG.configuringFromXmlDocument();
  return doConfigure( xmlHelper.createDOMReader().read( document ) );
}

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

/**
 * Use the mappings and properties specified in the given XML document.
 * The format of the file is defined in
 * <tt>hibernate-configuration-3.0.dtd</tt>.
 *
 * @param document an XML document from which you wish to load the configuration
 * @return A configuration configured via the <tt>Document</tt>
 * @throws HibernateException if there is problem in accessing the file.
 */
public Configuration configure(org.w3c.dom.Document document) throws HibernateException {
  LOG.configuringFromXmlDocument();
  return doConfigure( xmlHelper.createDOMReader().read( document ) );
}

相关文章

Configuration类方法