Filtering on exact elements contained in collection.

Posts   
 
    
rasmus
User
Posts: 5
Joined: 12-Jan-2005
# Posted on: 22-Feb-2007 10:29:45   

Hi,

I was wondering if it is possible to filter objects on an exact amount of elements in a collection on the object.

Here is an example:

Three tables:

Athlete 1---* Athlete2Medal *----1 Medal

The is m:n connection between Athlete and Medal and thus the AthleteEntity has a MedalCollection in the generated code.

Here is some sample Atheltes and their medals:

Schumacher {Gold, Silver, Bronce} Raikkonen {Silver, Bronce} Massa {Silver, Bronce}

Now I would like to find the Atheltes who have a MedalCollection that contains exactly {Silver, Bronce} which should yield Raikkonen and Massa, but not Schumacher.

How can I achieve this in LLBLGen (if it's even possible)?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 22-Feb-2007 14:28:38   

Please post the exact SQL Query that you want tp execute, and we will try to help you map it into LLBLGen code.

rasmus
User
Posts: 5
Joined: 12-Jan-2005
# Posted on: 22-Feb-2007 16:35:45   

Walaa wrote:

Please post the exact SQL Query that you want tp execute, and we will try to help you map it into LLBLGen code.

I don't know how to express it in sql either. I was hoping that someone might have a smart solution for this.

/Rasmus

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 22-Feb-2007 18:47:07   

It's similar to this thread (doesn't look like it at first, but it is) http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=8973

Frans Bouma | Lead developer LLBLGen Pro