How to create unique constraint for 2 columns in JDL-Studio?

前端 未结 3 430
走了就别回头了
走了就别回头了 2021-02-05 22:07

I have following entity configuration:

entity AirplaneModelSeat { 
    id Long, 
    seatNo String required 
}
relationship ManyToOne   { 
    AirplaneModelSeat{         


        
3条回答
  •  盖世英雄少女心
    2021-02-05 22:55

    As far as I know, constraints are not part of JDL in a general manner. You can define such things as validations. But as for the Domain, the unique constraint is not that general anymore, it is a database level constraint, where it has to be applied.

    For this, JHipster includes Liquibase. So you can find the changelog, defining the entity constraints in "src/main/resources/config/liquibase", and add a

    to that changelog.

    If you already started your application used h2 disk persistent databse, make a mvn clean / ./gradlew clean before starting your app again.

提交回复
热议问题