Handling of composite keys in hibernate + netbeans + java

0

In a Java desktop application I have to do a crud on a parent and a daughter table. The daughter has a key composed of the key of the parent table and another field. Using netbeans and hibernate I have generated the pojos of the two tables, but hibernate also generates a class that represents the primary key of the daughter table. I do not understand very well, how to make the crud on the daughter board. Can you help me with an example on how to make the crud on the daughter table. I appreciate your collaboration

    
asked by Julian 19.07.2017 в 22:39
source

1 answer

0

By the experience that I have on Hibernate, do the crud with the daughter the pojo with all the tranquility of the world.

As far as I know, that classe is the way hibernate has to understand that composite key as a unique concept.

that is, how these two values form a key:

two values - > classe - > class key that encapsulates the two values in an "@id"

    
answered by 20.07.2017 в 16:41