We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have to set composite primary key. how to do it? set tow @id on fileds?
The text was updated successfully, but these errors were encountered:
Keep the regular @Id Long id. But define a unique index over the properties that you want to use as the actual identifier:
@Id Long id
@Entity( // Define indexes spanning multiple columns here. indexes = { @Index(value = "prop1 DESC, prop2 DESC", unique = true) } ) public class YourEntity { @Id(autoincrement = true) Long id; Integer prop1; Long prop2; ... }
-ut
Sorry, something went wrong.
Thumbs up, so closing. -ut
No branches or pull requests
I have to set composite primary key. how to do it? set tow @id on fileds?
The text was updated successfully, but these errors were encountered: