These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Efficient collection insert
PostPosted: Mon May 09, 2011 5:33 pm 
Newbie

Joined: Mon May 09, 2011 5:22 pm
Posts: 1
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;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.