tamal123 wrote:
Can u please give teh example of your POJO and mapping.xml
After saving, did u go to the Db and see that the data is persisted / not ?
Yes, after saving and closing the app I saw the DB and it was ok. An example is the next one:
public class Dimension {
private String nombreDim;
private String descripcionDim;
private Ambito ambitoDim;
private Enfoque enfoqueDim;
private Set<Variable> variables;
public Enfoque getEnfoqueDim() {
return enfoqueDim;
}
public void setEnfoqueDim(Enfoque enfoqueDim) {
this.enfoqueDim = enfoqueDim;
}
public Ambito getAmbitoDim() {
return ambitoDim;
}
public void setAmbitoDim(Ambito ambitoDim) {
this.ambitoDim = ambitoDim;
}
public String getDescripcionDim() {
return descripcionDim;
}
public void setDescripcionDim(String descripcionDim) {
this.descripcionDim = descripcionDim;
}
public String getNombreDim() {
return nombreDim;
}
public void setNombreDim(String nombreDim) {
this.nombreDim = nombreDim;
}
public Set<Variable> getVariables() {
return variables;
}
public void setVariables(Set<Variable> variables) {
this.variables = variables;
}
}
and
<class name="model.Dimension" table="DIMENSIONES">
<id name="nombreDim" column="NOMBRE_DIM"/>
<property name="descripcionDim"/>
<property name="ambitoDim"/>
<property name="enfoqueDim"/>
<set name="variables" table="DIMENSION_VARIABLES">
<key column="NOMBRE_DIM"/>
<one-to-many class="model.Variable"/>
</set>
</class>
and also in hibernate.cfg.xml
<property name="hbm2ddl.auto">update</property>
Do you have any idea? Thank you very much, it's really important!