Hi!!
i have a problem mapping 3 tables and need help.
Tables:
Code:
create table Aumentos ( aumentos_id int not null primary key, ....... )
create table Aumentos_Detalle ( aumentos_id int not null, mod_sec_cc_id int not null, mod_sec_especialidad_id int not null, primary key (aumentos_id, mod_sec_cc_id, mod_sec_especialidad_id) )
create table Aumentos_Valor ( aumentos_id int not null, mod_sec_cc_id int not null, mod_sec_especialidad_id int not null, mod_sec_plan_id int not null, primary key (aumentos_id, mod_sec_cc_id, mod_sec_especialidad_id, mod_sec_plan_id) )
Classes:
Aumento / AumentoDetalle / AumentoValor
Code:
public class Aumento extends ... implements ... {
....
/** <AumentoDetalle> */
private Set detalles = new HashSet();
....
}
Code:
public class AumentoDetalle extends ... implements ... {
....
private SecundariaModalidad modalidadCentroCosto = null;
private SecundariaModalidad modalidadEspecialidad = null;
/** <AumentoValor> */
private Set valores = new HashSet();
....
}
Code:
public class AumentoValor extends ... implements ... {
....
private SecundariaModalidad modalidadCentroCosto = null;
private SecundariaModalidad modalidadEspecialidad = null;
private SecundariaModalidad modalidadPlan = null;
}
My doubts are:
Aumento and
AumentoDetalle must have bidirectional associations ? if not, how could hibernate realize that in order
to insert a record in 'Aumentos_Valor' it needs Aumento's id in 'AumentoDetalle' ?
AumentoDetalle and
AumentoValor should have bidirectional associations?
Thanks in advance,
Nicolas Gonzalez
P.S.: Sorry for my english!!
Code:
Code: