ZZTops wrote:
I do have a followup question regarding the where clause in the hbm mapping file. The document says it can be any sql statement. Should it be hql statement?
I don't think. If it behaves like formula, it's database specific SQL, though i suppose hibernate entity are allowed in it. The best answer is 'give it a try'
ZZTops wrote:
So I guess it's better to use straightforward queries if the relationship itself has properties. That means I have to define object class for the relationship as well, something I hate to do because it means composite id stuff unless there are other means that I'm not aware of (I guess one can add an id column to the Relationship table, but it is a rare practice).
Relationships with properties is always quite cumbersome to manage, it's like RelationShip Table which manage relation between 3 tables :)
I think the best is to think how you dispose you object before you think how you create database, unless the database is a forced one.
However, if you need to edit in your application the properties of the relation, you have no other choice then creating an Object for the relationShip. And instead of having People object storing People Sets, you'll have People Object storing Relations Sets(each relation having a type, a status, etc).