How do you map collections conditionally with Hibernate annotations?

I concluded that this is either impossible with bernate annotations or perhaps just not very obvious My solution was rather hackish: on Person I have a Transient annotated method which filters paints programmatically. Less than ideal because it may force an additional query to grab the Swatch entity I will not mark this as correct as I think Vineet Reynolds' answer to create a query is probably most reasonable in the case I presented. However, a query is harder to implement in my real scenario due to unmentioned factors which I thought were irrelevant to my example and mentioning them would have added significant complexity.

I concluded that this is either impossible with bernate annotations or perhaps just not very obvious. My solution was rather hackish: on Person I have a Transient annotated method which filters paints programmatically. Less than ideal because it may force an additional query to grab the Swatch entity.

I will not mark this as correct as I think Vineet Reynolds' answer to create a query is probably most reasonable in the case I presented. However, a query is harder to implement in my real scenario due to unmentioned factors which I thought were irrelevant to my example and mentioning them would have added significant complexity.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions