milasx wrote:
Quote:
(It makes no sense for a one-to-many association.)
Why would it not make sense? Could you please elaborate on it?
Simone
i am the newbie, so i don't really have a clue as to why it might be silly in most cases and i have not done the research yet. but in any case gavin said:
"...
(1) map 2 collections to the same table
(3) use a collection filter with projection
..."
my take on the first one is that one of the collections is the normal set of objects and is bi-directional. while the other might be some kind of one-way one to many that just went to the pk (somehow of the child table). maybe there is a way to tell hibernate to just use the value (fk) in the object and never chase down the reference). and is you never forces the load of the heavy duty set, then maybe you could just point the child to the parent and add the childs id to the parent's second set (i am guessing).
or maybe just jave another table that has the id's of the first (and nothing else) and load that set up up and use it? (isn't this an an index or something in some old dbms's?).
my take on the other is that there is a way to filter the collection and just get the keys with a projection. and that hibernate is smart enought to have the database do the filtering and projection. so all you would get would be the keys (or whatever subset of the data in the records that you were interested in).
also, iirc, that a previous post said something to the effect that just getting the keys (or pairs of keys) was a way that they did this with many to many (or maps or both or something). so there wil be some way to do this. i jut haven't quite figured out how.
but i can delay doing this for a while as i am just doing testing and working on small samples.
thanks