I created a simple class and mapping attributes to two different db entities in the ORM mapping diagram. The generated code has the wrong annotations. It just assumes all the columns are in the second entity. The java persistence API supports a class being persisted in multiple tables using the @SecondaryTable annotation.
The tool should either generate the right annotations or prevent the user from mapping attributes to more than one table.
Thank you for your post. One attribute can only be mapped with one column in an entity. Would you mind suggesting how you can map 1 attribute to multiple columns? I will ask our team to avoid that to happen.
I wasn’t referring to mapping one attribute to multiple columns. I was referring to mapping two attributes in the same class to columns in two different tables.
I just used the UI on the ORM diagram. I dragged a connection from one attribute to a column on an entity and then I dragged a connection from another attribute to a column on a different entity.