-
Jul 5th, 2010, 03:44 PM
#1
Indexed list in domain class
I have two domain model classes:
class Race {
List registrations
static hasMany = [registrations: Registration]
}
class Registration {
static belongsTo = [race: Race]
}
Grails created for me two databases:
CREATE TABLE `race` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
PRIMARY KEY (`id`)
)
CREATE TABLE `transport`.`registration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`race_id` bigint(20) NOT NULL,
`registrations_idx` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKAF83E8B958808C8F` (`race_id`)
)
I read a lot of info about GORM but didn't find how to map list to indexed column that I can provide(like @IndexedColumn in Hibernate), not automatic generated. I need to use my own index column. How it can be realized in Grails?
-
Jul 6th, 2010, 08:19 AM
#2
Of course Grails can do this
Just take a look at this section in the Grails Reference:
http://grails.org/doc/latest/ref/Dat...dexColumn.html
-
Jul 6th, 2010, 01:09 PM
#3
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules