I have a problem with a relation on Hibernate:
I have two Entities --> Solicitud and DetalleAccesorio, and the relation is:
I have one Solicitud with Many DetalleAccesorio, and I need to save the Solicitud with the DetalleAccesorio, and both are diferents tables on the database.. this is the important code of Solicitud:
@Id
@GeneratedValue( strategy=GenerationType.IDENTITY )
@Column( name="num_solicitud" )
private Long numSolicitud;
@OneToMany( fetch=FetchType.LAZY, mappedBy="codDetalle", cascade={ CascadeType.ALL } )
private List<DetalleAccesorio> listaAccesorios; `
What I need to save the same primary key of Solicitud on DetalleAccesorio?