Announcement Announcement Module
Collapse
No announcement yet.
roo command when primary key is based on sequence Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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;

    Comment

    Working...
    X