Replies: 1 comment
-
I found a solution without using JoinTable which looks a lot cleaner in my opinion. Instead of one-directional, I have updated it to be bi-directional using Note: The updated entities:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there!
I am having an issue with using the @jointable annotation when using a Composite Key in a One-To-Many relationship with Quarkus. The current error I am facing is 'Repeated column in mapping for collection'. This is because I am using an ID in both joinColumns and inverseJoinColumns within the @jointable. This ID needs two be in both places.
Is there something different about using composite keys with Quarkus that I am missing? I have researched that Quarkus does support it, but I could not find any example using the JoinTable annotation.
Here is some more context:
Tables
These two tables are in this scope.
The second table 'duck_mission' has only two columns, 'duck_id' and 'mission_id' in which both columns are foreign keys to their corresponding tables. The two foreign keys together make up the primary key of table 'duck_mission'. This table uses a CompositeKey to satisfy the requirement that all Entities MUST have a primary key. Note: mission_id is a foreign key to another table not listed here called 'Mission'.
ENTITIES
DUCK ENTITY
DUCK MISSION ENTITY
I have tried using @IdClass instead of an embeddedId, but it seems there is no difference between them. I also have tried substituting other values in place of the joinColumns. If I add (nullable = false, insertable=false, updatable=false) to the inverseJoinColumns, I then get the error 'null id generated for:class'.
If anyone has any insights or ideas that would be greatly appreciated! Thank you!
Beta Was this translation helpful? Give feedback.
All reactions