Results 1 to 2 of 2

Thread: roo command when primary key is based on sequence

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    Default roo command when primary key is based on sequence

    Hello,

    I would like to know what is the syntax to create an entity (--class) with a primary key matching a specific sequence name.
    Ex Table A as field A_PK and the PrimaryKey is given by the sequence A_SEQ.

    Thank you,

    Florian.

  2. #2
    Join Date
    Dec 2010
    Posts
    29

    Default

    As far as I know there's no command to do it. I just create my entity and then I push-in the Id property

    Code:
        
        @Id
        @SequenceGenerator(name = "gen", sequenceName = "A_SEQ")
        @GeneratedValue(generator = "gen")
        @Column(name = "A_PK")
        private Long id;

Posting Permissions

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