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

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

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

Configuration.determineCachedDomFile介绍

暂无

代码示例

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

/**
 * <b>INTENDED FOR TESTSUITE USE ONLY!</b>
 * <p/>
 * Much like {@link #addCacheableFile(File)} except that here we will fail immediately if
 * the cache version cannot be found or used for whatever reason
 *
 * @param xmlFile The xml file, not the bin!
 *
 * @return The dom "deserialized" from the cached file.
 *
 * @throws SerializationException Indicates a problem deserializing the cached dom tree
 * @throws FileNotFoundException Indicates that the cached file was not found or was not usable.
 */
public Configuration addCacheableFileStrictly(File xmlFile) throws SerializationException, FileNotFoundException {
  final File cachedFile = determineCachedDomFile( xmlFile );
  final boolean useCachedFile = xmlFile.exists()
      && cachedFile.exists()
      && xmlFile.lastModified() < cachedFile.lastModified();
  if ( ! useCachedFile ) {
    throw new FileNotFoundException( "Cached file could not be found or could not be used" );
  }
  LOG.readingCachedMappings( cachedFile );
  Document document = ( Document ) SerializationHelper.deserialize( new FileInputStream( cachedFile ) );
  add( new XmlDocumentImpl( document, "file", xmlFile.getAbsolutePath() ) );
  return this;
}

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

/**
 * <b>INTENDED FOR TESTSUITE USE ONLY!</b>
 * <p/>
 * Much like {@link #addCacheableFile(File)} except that here we will fail immediately if
 * the cache version cannot be found or used for whatever reason
 *
 * @param xmlFile The xml file, not the bin!
 *
 * @return The dom "deserialized" from the cached file.
 *
 * @throws SerializationException Indicates a problem deserializing the cached dom tree
 * @throws FileNotFoundException Indicates that the cached file was not found or was not usable.
 */
public Configuration addCacheableFileStrictly(File xmlFile) throws SerializationException, FileNotFoundException {
  final File cachedFile = determineCachedDomFile( xmlFile );
  final boolean useCachedFile = xmlFile.exists()
      && cachedFile.exists()
      && xmlFile.lastModified() < cachedFile.lastModified();
  if ( ! useCachedFile ) {
    throw new FileNotFoundException( "Cached file could not be found or could not be used" );
  }
  LOG.readingCachedMappings( cachedFile );
  Document document = ( Document ) SerializationHelper.deserialize( new FileInputStream( cachedFile ) );
  add( new XmlDocumentImpl( document, "file", xmlFile.getAbsolutePath() ) );
  return this;
}

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

File cachedFile = determineCachedDomFile( xmlFile );

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

File cachedFile = determineCachedDomFile( xmlFile );

相关文章

Configuration类方法