Reputation: 103
I want to create two entities.
Departments(Department Id,Department Name) and Employees(Employee Id, Employee Name, Address).
I want these primary keys for the tables:
Department Id for Departments, Employee Id for Employees.
And Jhipster creates two tables as: Departments(Id, Department Id, Department Name) and Empployee(Id, Employee Id, Employee Name, Address)
and it takes Id as a primary key in both of these tables.
In my Database Design I want Department Id and Employee Id as a primary key. So what to do next?
Upvotes: 9
Views: 12516
Reputation: 16284
[deperecated]
You can't do it automatically in JHipster, you must edit generated code manually. A module could help at least for column names: https://github.com/bastienmichaux/generator-jhipster-db-helper
Upvotes: 4
Reputation: 1877
Support for custom ids was added in the new JHipster Release v7.0.0.
In JDL you can write:
entity Foo {
@Id customId Long
}
or
entity Foo {
id UUID
}
see https://github.com/jhipster/generator-jhipster/pull/13258
Upvotes: 12