Adding keys and AUTO_INCREMENT
No. 3
Q: |
Modify the current
The resulting SQL - DDL shall look like:
|
||||||
A: |
We do need the following changes with respect to : @Entity @Table(uniqueConstraints= { @UniqueConstraint(columnNames={"name"}, name="uniqueAirlineName") ❶ ,@UniqueConstraint(columnNames={"icaoCode"}, name="uniqueIcaoCode") ❷ }) public class Airline { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) ❸ Long id; @Column(nullable=false) ❹ String name; @Column(nullable=false) ❺ String icaoCode; ... }
|