in my Oracle database, I have many tables with a simple non-incremental integer key (no UUID).
However, while there is BaseStringIdEntity there is no corresponding entities with integer key.
If I try to use BaseIntegerIdEntity or BaseLongIdEntity, the key of the table is always called id and seems to be impossible to change this setting.
As a workaround I have implemented, for each table, a key embedded with a single integer field.
First question: Whereas I can not change the database schema, I’m doing something that makes sense?
Second question: when the key of this table is related in many-to-one inside another table … how should I define the attribute? Embedded? If I do so I get something like:
@AttributeOverride (Name = “tgn0701” column = @Column (name = “ANA1021”))
protected Tgn07PK ana1021;
But I have no relationship in DDL preview, between ana10 table (customers) and tgn07 table (type of customer)
This causes me a lot of confusion, because it is impossible to manage a integer key exactly as a string key, with many-to-one relationship into another table?
I enclose entire project. An example of a table with integer key is tgn07 with the relative EmbeddableEntity tgn07PK. The table ana10 customer has the ana1021 field that should have many-to-one relationship with tgn07 (or tgn07pk?).
Any help is appreciated.