SdemPagoIntereses.java
Code:
<hibernate-mapping package="cr.go.ice.sde.domain">
<class name="Sdem_pago_interesesInfo" table="SDEM_PAGO_INTERESES">
<composite-id class="Sdem_pago_interesesPK" name="id">
<key-many-to-one class="Sdem_prestamoPK" name="id">
<column name="COD_SECTOR" />
<column name="COD_PRESTAMO" />
</key-many-to-one>
<key-many-to-one
class="Sdec_monedaInfo"
column="COD_MONEDA"
name="codMoneda"
/>
<key-property
column="COD_PAGOINTERES"
name="codPagointeres"
type="integer"
/>
</composite-id>
<property .....
Sdem_interesesInfo.java
Code:
private int hashCode = Integer.MIN_VALUE;
// primary key
private Sdem_pago_interesesPK id;
// fields
private java.lang.Integer montoMoneda;
private java.lang.Integer estado;
private java.lang.Integer tipoCambio;
private java.lang.String observaciones;
private java.lang.Integer montoDolares;
private java.util.Date fechaPagointeres;
// constructors
public Sdem_pago_interesesInfo () {}
/**
* Constructor for primary key
*/
public Sdem_pago_interesesInfo (Sdem_pago_interesesPK id) {
this.setId(id);
}
/**
* Return the unique identifier of this class
* @hibernate.id
*/
public Sdem_pago_interesesPK getId () {
return id;
}
/**
* Set the unique identifier of this class
* @param id the new ID
*/
public void setId (Sdem_pago_interesesPK id) {
this.id = id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: MONTOMONEDA
*/
public java.lang.Integer getMontoMoneda () {
return montoMoneda;
}
....
And Pago_interesesPK which is used by the Pago_interesesInfo as PK.
Code:
public class Sdem_pago_interesesPK implements Serializable {
private int hashCode = Integer.MIN_VALUE;
private Sdem_prestamoPK id;
private Sdec_monedaInfo codMoneda;
private java.lang.Integer codPagointeres;
public Sdem_pago_interesesPK () {}
/**
* @return Returns the idPrestamo.
*/
public Sdem_prestamoPK getId() {
return id;
}
/**
* @param id The idPrestamo to set.
*/
public void setId(Sdem_prestamoPK id) {
this.id = id;
}
public Sdem_pago_interesesPK (
Sdem_prestamoPK id,
Sdec_monedaInfo codMoneda,
java.lang.Integer codPagointeres) {
this.setId(id);
this.setCodMoneda(codMoneda);
this.setCodPagointeres(codPagointeres);
}
public Sdec_monedaInfo getCodMoneda () {
return codMoneda;
}
public void setCodMoneda (Sdec_monedaInfo codMoneda) {
hashCode = Integer.MIN_VALUE;
this.codMoneda = codMoneda;
}
...
Thats it.. is another relashionship like the one between Prestamo and Amortizacion.