如何定义< element-collection> List< String>场地? [英] how to define <element-collection> for a List<String> field?
本文介绍了如何定义< element-collection> List< String>场地?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我的对象有一个
protected List<String> fileNote;
在orm.xml中定义该关系的正确方法是什么?
What is the right way to define that relationship in an orm.xml?
(注意:我不是要使用注释.)
(note: I do not want to use annotations.)
推荐答案
最简单,如果您对默认值感到满意的话:
Most simple, if you are satisfied with defaults is:
<element-collection name="fileNote"/>
如果需要更多自定义,则可以进一步:
If more customization is needed, you can go further:
<element-collection name="fileNote" fetch="EAGER" access="FIELD/>
<column name="some_name_for_column_that_holds_note" />
<collection-table name="descriptive_name_for_table">
<join-column name="some_id" />
</collection-table>
</element-collection/>
这篇关于如何定义< element-collection> List< String>场地?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文