I plan to integrate ORM into my project, so I used the Eclipse JPA project to create feature classes from old databases. A total of 168 entity classes where it is generated and this is normal. But in some restrictions, such as nullable
, unique
they are not automatically generated.
For example, I need something like this: -
@Column(name="USER_NAME",unique = true)
private String userName;
but after auto-generating entities, there is no unique restriction in the code. How can I achieve this simply?
Any suggestions would be helpful.
source
share