Hi,
I have a entity with a Many-to-many collection with potentially high number of elements. I mapped it using a idbag, which is described as the best choice for fast update and remove.
However, each time I insert a element the entire collection is loaded in the memory.
How can I map a Many-to-many (owner side) association as the add operation does not load the entire (lazy) collection?
ps.: My current map configuration are:
Code:
@ManyToMany(fetch=FetchType.LAZY)
@LazyCollection(LazyCollectionOption.EXTRA)
@CollectionId(columns={@Column(name="id")}, type=@Type(type="long"),
generator = "sequence")
private Collection<PersonGEOData> persons;