I've got MySQL database which is used for PHP CMS system and I would like to do Grails application based on that database. In MYSQL I have tables contact, individual and organisation
contact: int id
individual int id
int contact_id ( FOREIGN KEY )
organisation int id
So I would like in Grails to have Contact as domain class and parent for Individual and Organisation
but I can't find a proper definition for mapping to get list of Individuals ( i didnt include my mappings in the code because they dont work ).
I haven't done this before so I can't say for sure how to map it, but you could try creating a similar model in a test app and let Grails create the schema and see what it does. That should give you some clues as to how to map it.
One thing you will need to do is set the mapping to table per class instead table per hierarchy. Like this: