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

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

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

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.. ");
    }
  }
}

相关文章

Configuration类方法