cod*_*r25 6 java hibernate jpa
我正在尝试创建一个本地命名查询.我看到了链接
<sql-result-set-mapping name="BookAuthorMappingXml">
<entity-result entity-class="org.thoughts.on.java.jpa.model.Author">
<field-result name="id" column="authorId"/>
<field-result name="firstName" column="firstName"/>
<field-result name="lastName" column="lastName"/>
<field-result name="version" column="authorVersion"/>
</entity-result>
<entity-result entity-class="org.thoughts.on.java.jpa.model.Book">
<field-result name="id" column="id"/>
<field-result name="title" column="title"/>
<field-result name="author" column="author_id"/>
<field-result name="version" column="version"/>
</entity-result>
</sql-result-set-mapping>
Run Code Online (Sandbox Code Playgroud)
我拥有的列数超过20.我们可以一次性映射所有列
我正在使用hibernate 4.2
您需要的是休眠映射自动生成。您可以关注 mkyong 的博客
https://www.mkyong.com/hibernate/how-to-generate-code-with-hibernate-tools/
| 归档时间: |
|
| 查看次数: |
730 次 |
| 最近记录: |