Collection bag with annotation

I watch a good video made by Burt Beckwith

http://www.infoq.com/presentations/GORM-Performance

He says:

"In traditional sleep mode, you can map the collection as a bag,

which is just a regular collection without any orders or uniqueness, guarantees

How can I match this collection without ordering or uniqueness with annotation? Thanks.

+4
source share
1 answer

If you use List as a reference type but do not specify an index number column, you will have an unordered collection without requiring uniqueness. Yes, the list is an ordered collection at the java level, but there is no guarantee that copies of object instances are in the same order.

 @OneToMany private List<OtherEntity> otherEntities; 

What all!

+8
source

All Articles