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

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

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

Configuration.addXML介绍

暂无

代码示例

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

@Override
public AnnotationConfiguration addXML(String xml) throws MappingException {
  super.addXML( xml );
  return this;
}

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

@Override
public AnnotationConfiguration addXML(String xml) throws MappingException {
  super.addXML( xml );
  return this;
}

代码示例来源:origin: babyfish-ct/babyfish

@Override
public Configuration addXML(String xml) throws MappingException {
  super.addXML(xml);
  return this;
}

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

@Override
public AnnotationConfiguration addXML(String xml) throws MappingException {
  super.addXML( xml );
  return this;
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

protected Configuration makeMapping(String className, String custommapping1)
{
  Configuration hibconfig = new Configuration();
  {
    hibconfig.addXML(makeMapping(className, "xwikicustom_" + className.replaceAll("\\.", "_"), custommapping1));
  }
  hibconfig.buildMappings();
  return hibconfig;
}

代码示例来源:origin: ch.epfl.gsn/gsn-core

cfg.setProperty("hibernate.show_sql", "false");
cfg.setProperty("hibernate.format_sql", "true");
cfg.addXML(entityMapping);

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

public boolean injectCustomMapping(BaseClass doc1class, XWikiContext context) throws XWikiException
{
  // If we haven't turned of dynamic custom mappings we should not inject them
  if (context.getWiki().hasDynamicCustomMappings() == false) {
    return false;
  }
  String custommapping = doc1class.getCustomMapping();
  if (!doc1class.hasExternalCustomMapping()) {
    return false;
  }
  Configuration config = getConfiguration();
  // don't add a mapping that's already there
  if (config.getClassMapping(doc1class.getName()) != null) {
    return true;
  }
  Configuration mapconfig = makeMapping(doc1class.getName(), custommapping);
  if (!isValidCustomMapping(doc1class.getName(), mapconfig, doc1class)) {
    throw new XWikiException(XWikiException.MODULE_XWIKI_STORE,
      XWikiException.ERROR_XWIKI_STORE_HIBERNATE_INVALID_MAPPING, "Invalid Custom Mapping");
  }
  config.addXML(makeMapping(doc1class.getName(), "xwikicustom_" + doc1class.getName().replaceAll("\\.", "_"),
    custommapping));
  config.buildMappings();
  return true;
}

相关文章

Configuration类方法