Description des structures
merci à OButterlin pour sa réaction.
Voila les complements délément qu'il a demandé.
- la structure de la table
CREATE TABLE NOYP_SUSPENSION_INTER
(
ID VARCHAR2(25 BYTE) NOT NULL,
CODE_INTER VARCHAR2(25 BYTE) NOT NULL,
DATE_EFFET_SUSPINT DATE NOT NULL,
DATESUSP_SUSPINT DATE,
MOTIF_SUSPINT VARCHAR2(1000 BYTE),
DTE_UTI_SUSPINT DATE NOT NULL,
CODE_UTI VARCHAR2(20 BYTE) NOT NULL,
CODE_UTI_MODIF VARCHAR2(20 BYTE),
DTE_UTI_MODIF DATE,
CODE_UNITE VARCHAR2(25 BYTE) NOT NULL,
MOTIF_LEVEE_SUSPINT VARCHAR2(1000 BYTE),
SUSPLEVEE_SUSPINT VARCHAR2(1 BYTE) NOT NULL,
DATE_LEVEE_SUSPINT DATE
);
CREATE UNIQUE INDEX PK_SUSPENSION_INTER ON NOYP_SUSPENSION_INTER
(ID);
- le fichier hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.afrikbrain.iard.srv.interm">
<class
name="SuspensionInter"
table="NOYP_SUSPENSION_INTER"
>
<meta attribute="sync-DAO">false</meta>
<id
name="Id"
type="string"
column="ID"
>
<generator class="assigned"/>
</id>
<property
name="DateEffet"
column="DATE_EFFET_SUSPINT"
type="date"
not-null="true"
length="7"
/>
<property
name="DateSusp"
column="DATESUSP_SUSPINT"
type="date"
not-null="false"
length="7"
/>
<property
name="MotifSusp"
column="MOTIF_SUSPINT"
type="string"
not-null="false"
length="1000"
/>
<property
name="DteUtiSusp"
column="DTE_UTI_SUSPINT"
type="date"
not-null="true"
length="7"
/>
<property
name="CodeUti"
column="CODE_UTI"
type="string"
not-null="true"
length="20"
/>
<property
name="CodeUtiModif"
column="CODE_UTI_MODIF"
type="string"
not-null="false"
length="20"
/>
<property
name="DteUtiModif"
column="DTE_UTI_MODIF"
type="date"
not-null="false"
length="7"
/>
<property
name="MotifLevee"
column="MOTIF_LEVEE_SUSPINT"
type="string"
not-null="false"
length="1000"
/>
<property
name="EstLevee"
column="SUSPLEVEE_SUSPINT"
type="string"
not-null="true"
length="1"
/>
<property
name="DateLevee"
column="DATE_LEVEE_SUSPINT"
type="date"
not-null="true"
length="7"
/>
<many-to-one
name="Unite"
column="CODE_UNITE"
class="com.afrikbrain.iard.srv.ref.Unite"
not-null="true"
>
</many-to-one>
<many-to-one
name="Intermédiaire"
column="CODE_INTER"
class="Intermediaire"
not-null="true"
>
</many-to-one>
</class>
</hibernate-mapping>
- le pojo associé
J'espère que je ne me suis pas trompé pour ce point
package com.afrikbrain.iard.srv.interm.base;
import java.io.Serializable;
/**
* This is an object that contains data related to the NOYP_SUSPENSION_INTER table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="NOYP_SUSPENSION_INTER"
*/
public abstract class BaseSuspensionInter implements Serializable {
public static String REF = "SuspensionInter";
public static String PROP_CODE_UTI = "CodeUti";
public static String PROP_DATE_EFFET = "DateEffet";
public static String PROP_INTERMÉDIAIRE = "Intermédiaire";
public static String PROP_DTE_UTI_SUSP = "DteUtiSusp";
public static String PROP_MOTIF_SUSP = "MotifSusp";
public static String PROP_DATE_LEVEE = "DateLevee";
public static String PROP_CODE_UTI_MODIF = "CodeUtiModif";
public static String PROP_DATE_SUSP = "DateSusp";
public static String PROP_UNITE = "Unite";
public static String PROP_ID = "Id";
public static String PROP_EST_LEVEE = "EstLevee";
public static String PROP_DTE_UTI_MODIF = "DteUtiModif";
public static String PROP_MOTIF_LEVEE = "MotifLevee";
// constructors
public BaseSuspensionInter () {
initialize();
}
/**
* Constructor for primary key
*/
public BaseSuspensionInter (java.lang.String id) {
this.setId(id);
initialize();
}
/**
* Constructor for required fields
*/
public BaseSuspensionInter (
java.lang.String id,
com.afrikbrain.iard.srv.ref.Unite unite,
com.afrikbrain.iard.srv.interm.Intermediaire intermédiaire,
java.util.Date dateEffet,
java.util.Date dteUtiSusp,
java.lang.String codeUti,
java.lang.String estLevee,
java.util.Date dateLevee) {
this.setId(id);
this.setUnite(unite);
this.setIntermédiaire(intermédiaire);
this.setDateEffet(dateEffet);
this.setDteUtiSusp(dteUtiSusp);
this.setCodeUti(codeUti);
this.setEstLevee(estLevee);
this.setDateLevee(dateLevee);
initialize();
}
protected void initialize () {}
private int hashCode = Integer.MIN_VALUE;
// primary key
private java.lang.String id;
// fields
private java.util.Date dateEffet;
private java.util.Date dateSusp;
private java.lang.String motifSusp;
private java.util.Date dteUtiSusp;
private java.lang.String codeUti;
private java.lang.String codeUtiModif;
private java.util.Date dteUtiModif;
private java.lang.String motifLevee;
private java.lang.String estLevee;
private java.util.Date dateLevee;
// many to one
private com.afrikbrain.iard.srv.ref.Unite unite;
private com.afrikbrain.iard.srv.interm.Intermediaire intermédiaire;
/**
* Return the unique identifier of this class
* @hibernate.id
* generator-class="assigned"
* column="ID"
*/
public java.lang.String getId () {
return id;
}
/**
* Set the unique identifier of this class
* @param id the new ID
*/
public void setId (java.lang.String id) {
this.id = id;
this.hashCode = Integer.MIN_VALUE;
}
/**
* Return the value associated with the column: DATE_EFFET_SUSPINT
*/
public java.util.Date getDateEffet () {
return dateEffet;
}
/**
* Set the value related to the column: DATE_EFFET_SUSPINT
* @param dateEffet the DATE_EFFET_SUSPINT value
*/
public void setDateEffet (java.util.Date dateEffet) {
this.dateEffet = dateEffet;
}
/**
* Return the value associated with the column: DATESUSP_SUSPINT
*/
public java.util.Date getDateSusp () {
return dateSusp;
}
/**
* Set the value related to the column: DATESUSP_SUSPINT
* @param dateSusp the DATESUSP_SUSPINT value
*/
public void setDateSusp (java.util.Date dateSusp) {
this.dateSusp = dateSusp;
}
/**
* Return the value associated with the column: MOTIF_SUSPINT
*/
public java.lang.String getMotifSusp () {
return motifSusp;
}
/**
* Set the value related to the column: MOTIF_SUSPINT
* @param motifSusp the MOTIF_SUSPINT value
*/
public void setMotifSusp (java.lang.String motifSusp) {
this.motifSusp = motifSusp;
}
/**
* Return the value associated with the column: DTE_UTI_SUSPINT
*/
public java.util.Date getDteUtiSusp () {
return dteUtiSusp;
}
/**
* Set the value related to the column: DTE_UTI_SUSPINT
* @param dteUtiSusp the DTE_UTI_SUSPINT value
*/
public void setDteUtiSusp (java.util.Date dteUtiSusp) {
this.dteUtiSusp = dteUtiSusp;
}
/**
* Return the value associated with the column: CODE_UTI
*/
public java.lang.String getCodeUti () {
return codeUti;
}
/**
* Set the value related to the column: CODE_UTI
* @param codeUti the CODE_UTI value
*/
public void setCodeUti (java.lang.String codeUti) {
this.codeUti = codeUti;
}
/**
* Return the value associated with the column: CODE_UTI_MODIF
*/
public java.lang.String getCodeUtiModif () {
return codeUtiModif;
}
/**
* Set the value related to the column: CODE_UTI_MODIF
* @param codeUtiModif the CODE_UTI_MODIF value
*/
public void setCodeUtiModif (java.lang.String codeUtiModif) {
this.codeUtiModif = codeUtiModif;
}
/**
* Return the value associated with the column: DTE_UTI_MODIF
*/
public java.util.Date getDteUtiModif () {
return dteUtiModif;
}
/**
* Set the value related to the column: DTE_UTI_MODIF
* @param dteUtiModif the DTE_UTI_MODIF value
*/
public void setDteUtiModif (java.util.Date dteUtiModif) {
this.dteUtiModif = dteUtiModif;
}
/**
* Return the value associated with the column: MOTIF_LEVEE_SUSPINT
*/
public java.lang.String getMotifLevee () {
return motifLevee;
}
/**
* Set the value related to the column: MOTIF_LEVEE_SUSPINT
* @param motifLevee the MOTIF_LEVEE_SUSPINT value
*/
public void setMotifLevee (java.lang.String motifLevee) {
this.motifLevee = motifLevee;
}
/**
* Return the value associated with the column: SUSPLEVEE_SUSPINT
*/
public java.lang.String getEstLevee () {
return estLevee;
}
/**
* Set the value related to the column: SUSPLEVEE_SUSPINT
* @param estLevee the SUSPLEVEE_SUSPINT value
*/
public void setEstLevee (java.lang.String estLevee) {
this.estLevee = estLevee;
}
/**
* Return the value associated with the column: DATE_LEVEE_SUSPINT
*/
public java.util.Date getDateLevee () {
return dateLevee;
}
/**
* Set the value related to the column: DATE_LEVEE_SUSPINT
* @param dateLevee the DATE_LEVEE_SUSPINT value
*/
public void setDateLevee (java.util.Date dateLevee) {
this.dateLevee = dateLevee;
}
/**
* Return the value associated with the column: CODE_UNITE
*/
public com.afrikbrain.iard.srv.ref.Unite getUnite () {
return unite;
}
/**
* Set the value related to the column: CODE_UNITE
* @param unite the CODE_UNITE value
*/
public void setUnite (com.afrikbrain.iard.srv.ref.Unite unite) {
this.unite = unite;
}
/**
* Return the value associated with the column: CODE_INTER
*/
public com.afrikbrain.iard.srv.interm.Intermediaire getIntermédiaire () {
return intermédiaire;
}
/**
* Set the value related to the column: CODE_INTER
* @param intermédiaire the CODE_INTER value
*/
public void setIntermédiaire (com.afrikbrain.iard.srv.interm.Intermediaire intermédiaire) {
this.intermédiaire = intermédiaire;
}
public boolean equals (Object obj) {
if (null == obj) return false;
if (!(obj instanceof com.afrikbrain.iard.srv.interm.SuspensionInter)) return false;
else {
com.afrikbrain.iard.srv.interm.SuspensionInter suspensionInter = (com.afrikbrain.iard.srv.interm.SuspensionInter) obj;
if (null == this.getId() || null == suspensionInter.getId()) return false;
else return (this.getId().equals(suspensionInter.getId()));
}
}
public int hashCode () {
if (Integer.MIN_VALUE == this.hashCode) {
if (null == this.getId()) return super.hashCode();
else {
String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
this.hashCode = hashStr.hashCode();
}
}
return this.hashCode;
}
public String toString () {
return super.toString();
}
}