Hibernate calls object references an unsaved transient but this leads to redundances

343
July 04, 2017, at 03:52 AM

I am using Hibernate in a Project and I have a ManyToMany relation between two Objects. The Problem is the following: When saving a new Object Hibernate calls "unsaved transient" if I donĀ“t save its related Objects beforehand. But otherwise I get redundances in my Database because different Objects may relate to the same entry. In my case I am retrieving Documents from an API and a Document may have several Authors but Hibernate wants to save every Author even so they might already be in the DB. Is there a designated way to handle this in hibernate? I am thankful for any kind of advice.

Rent Charter Buses Company
READ ALSO
Byte array of 3/3/2 RGB samples to BufferedImage in Java

Byte array of 3/3/2 RGB samples to BufferedImage in Java

I have a byte array, where each byte describes one pixel (256 colors)Here is bitmask that I use: 0xRRRGGGBB So there are 3 bits for R and G components and 2 bits for B component

506
Java enum get string by index [duplicate]

Java enum get string by index [duplicate]

This question already has an answer here:

572