首页 > 解决方案 > Where 子句在 Hibernate 5 XML 映射中不起作用

问题描述

我使用了带有 XML 映射的 Hibernate 4,代码是:

 <map name="scormData" table="scorm_data_attempt" where="current">
        <key>
            <column name="userid" />
            <column name="course_id" />
        </key>
        <composite-map-key class="ScormDataKey">
            <key-property name="scormId" column="scorm_id"
                type="integer" />
            <key-property name="variableName" column="variable_name"
                type="string" />
            <key-property name="attempt" />
        </composite-map-key>
        <element type="string" column="variable_value" />
    </map>

但是,现在当我更改为 Hibernate 5 时,where 字段不再起作用,我无法从当前列中检索数据。有谁知道为什么以及如何解决它?

标签: javapostgresqlhibernate

解决方案


推荐阅读