Hibernate全局“动态插入” [英] Hibernate global "dynamic-insert"

查看:114
本文介绍了Hibernate全局“动态插入”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Hibernate全局设置 dynamic-insert 属性(所以它将成为所有实体的默认值)?


<在NHibernate中它是

  foreach(var clazz in config .ClassMappings)
{
clazz.DynamicInsert = true;
}

我不知道hibernate中的确切语法。

  for(PersistentClass clazz:configuration.ClassMappings)
{
clazz.setDynamicInsert(true);
}


Is there way to set the dynamic-insert attribute globally with Hibernate (so it would be the default for all entities) ?

解决方案

in NHibernate it is

foreach (var clazz in config.ClassMappings)
{
    clazz.DynamicInsert = true;
}

i don't know the exact syntax in hibernate.

for (PersistentClass clazz : configuration.ClassMappings)
{
    clazz.setDynamicInsert(true);
}

这篇关于Hibernate全局“动态插入”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆