我们可以在hibernate的select或update查询中使用表名而不是java类名吗?

时间:2012-02-28 08:47:34

标签: java hibernate

在hibernate中,我们通常在select和update查询中使用类名。我的问题是可以直接给表名(如果用户想要在某些情况下)。例如: - 在下面的查询中,我有表名作为ContentModification。 / p>

select from ContentModification as cm where cm.XWC_NAME=:spaceName
update ContentModification set  lastname="miles"

另一个问题是我们可以在hibernate中使用查询对象来插入数据(比如insert into ..)。每个我只看到更新和选择的例子。

1 个答案:

答案 0 :(得分:2)

Create native query

但是为什么首先要打扰hibernate呢?