本文整理了Java中org.hibernate.cfg.Configuration.addDocument()
方法的一些代码示例,展示了Configuration.addDocument()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.addDocument()
方法的具体详情如下:
包路径:org.hibernate.cfg.Configuration
类名称:Configuration
方法名:addDocument
[英]Read mappings from a DOM Document
[中]从DOM文档读取映射
代码示例来源:origin: org.hibernate/hibernate-annotations
@Override
public AnnotationConfiguration addDocument(org.w3c.dom.Document doc) throws MappingException {
super.addDocument( doc );
return this;
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
@Override
public AnnotationConfiguration addDocument(org.w3c.dom.Document doc) throws MappingException {
super.addDocument( doc );
return this;
}
代码示例来源:origin: babyfish-ct/babyfish
@Override
public Configuration addDocument(Document doc) throws MappingException {
super.addDocument(doc);
return this;
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
@Override
public AnnotationConfiguration addDocument(org.w3c.dom.Document doc) throws MappingException {
super.addDocument( doc );
return this;
}
代码示例来源:origin: org.nakedobjects/nos-objectstore-hibernate
/**
* Add all classes loaded in Naked Objects to the hibernate configuration
*/
public void configure(final Configuration cfg) {
final Mappings mappings = cfg.createMappings();
for (Iterator<PersistentNakedClass> iter = persistentClasses.getPersistentClasses(); iter.hasNext();) {
final PersistentNakedClass persistentClass = iter.next();
final String className = persistentClass.getName();
if (mappings.getClass(className) == null) {
LOG.debug("binding persistent class " + className);
final Document doc4j = createDocument(persistentClass);
org.w3c.dom.Document docW3c = createW3cDoc(doc4j);
cfg.addDocument(docW3c);
writeMappingDoc(doc4j, className);
} else {
LOG.info("class [" + className + "] is already mapped, skipping.. ");
}
}
}
内容来源于网络,如有侵权,请联系作者删除!