S
S
sasuke222020-08-03 10:11:11
Java
sasuke22, 2020-08-03 10:11:11

How to create a table in Hibernate without a unique Id?

Hello! In tables, you cannot add an additional field (Id) and there are no unique values. Are there ways to create a table through Hibernate or will I have to create it myself in the database and write a query through jdbcTemplate? Is it possible to make Id not a unique value?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2020-08-03
@sasuke22

If I understand you correctly, then you are going to store some data in the table whose id is not a unique value. You can in any case have a unique one. id by adding an annotation @Id
And you can save a non-unique id as another field. For example, nativeId

Is it possible to make Id not a unique value?

No.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question