本文整理了Java中org.hibernate.cfg.Configuration.determineCachedDomFile()
方法的一些代码示例,展示了Configuration.determineCachedDomFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.determineCachedDomFile()
方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称: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 );
内容来源于网络,如有侵权,请联系作者删除!