grails/gorm seems to ignore column names on join table on many to many relationship if one domain class has composite id, example:
class Following implements Serializable {
...
static hasMany = [operationTypes:OperationType]
static belongsTo = OperationType
static mappedBy = [operationTypes:'followings']
static mapping = {
...
id composite: ['offer', 'user']
offer column: 'offer_oid'
user column: 'user_oid'
operationTypes joinTable: [name: 'operationtype_following', key: ['favorite_user_offer_oid', 'favorite_user_user_oid']]
}
}
and:
class OperationType implements Serializable {
...
static hasMany = [offers:Offer, advices:Advice, followings:Following]
static mappedBy = [followings:'operationTypes']
static mapping = {
....
followings joinTable: [name: 'operationtype_following', key: 'operationtype_oid']
}
}
Results in: MappingException: Foreign key (FK_lhri681gwbef5a9y6ylhoakpj:operationtype_following [favorite_user_offer_oid, favorite_user_user_oid,Following_offer_id,Following_user_id])) must have same number of columns as the referenced primary key (favorite_user [user_oid,offer_oid])
So why it not really ignores column names but adds generated column names to the specified ones?
Grails 2.4.3 is used. Any help appreciated