-->
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.  [ 2 posts ] 
Author Message
 Post subject: possible to populate Collection cache node but not Entitites
PostPosted: Sun May 10, 2009 1:31 am 
Beginner
Beginner

Joined: Thu Apr 13, 2006 12:56 pm
Posts: 23
Let's say we have Parent, Child cached entities and parent.children cached collection:

Code:
    @OneToMany(mappedBy="parent") 
    @LazyCollection(LazyCollectionOption.TRUE)
    @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL)
    Set<Child> getChildren()


Let's suppose the collection is really big, and it's important to be able to quickly ascertain whether a given childID is part of it. But only a small percentage of Child entities will actually be needed. Is it possible to fetch a collection (parent.getChildren()) in such a way that Collection cache is populated (with a list of child IDs) but Child Entities are NOT inserted into cache? Something like:

parent.getChildren(); //adds 1 node to Collection cache. node contains all related childIDs

Set<Long> neededChildIDs = otherService.getChildIDs();

//Load and cache only children whose IDs appear in both parent.getChildren() and neededChildIDs.

thanks!


Top
 Profile  
 
 Post subject: Re: possible to populate Collection cache node but not Entitites
PostPosted: Mon May 11, 2009 8:35 pm 
Beginner
Beginner

Joined: Thu Apr 13, 2006 12:56 pm
Posts: 23
Anyone? Should I provide own CollectionInitializer?


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.