Grails GORM: How do I create a composite primary key and use it for a table relationship?
问题 I have two tables, one of which (legacy table: A) has two fields that should serve as a composite foreign key and the other one (new table: B) should use a composite primary key for a each row:A has one row:B relationship. How do I describe these tables in terms of GORM? So far I've been able to create a domain class that reflects the legacy table:A class A { ... //composite foreign key to link B class String className; String eventName; B b; //instance of B to be related static mapping = {