Results 1 to 3 of 3

Thread: Indexed list in domain class

  1. #1

    Default 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?

  2. #2
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    7

    Default

    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

  3. #3

    Default

    Thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •