この例外が発生しています:org.hibernate.MappingException: collection foreign key mapping has wrong number of columns: Room.cellsOrig type: component[locationX,locationY]
class Room implements Serializable {
Integer locationX;
Integer locationY;
List cellsOrig = []
List cells = []
static hasMany = [cellsOrig: Cell, cells: Cell]
static mapping = { id composite['locationX', 'locationY']
cells joinTable:'room_cells'
cellsOrig joinTable:'room_cells_orig'
}
static constrants = { locationX(nullable: false) locationY(nullable: false)
cells(nullable: false) cellsOrig(nullable: false)
}
}
私は joinTable を間違って実行していると思いますが、joinTables がないと Room インスタンスの cell または cellOrig プロパティにアクセスするとorg.hibernate.HibernateException: null index column for collection: Room.cells
.
複合 ID を処理できるように joinTable を実行する方法について何か提案はありますか?