le code mapping est
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 3 f?vr. 2010 14:39:37 by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="org.yournamehere.client.Assure" table="ASSURE" schema="CMH" lazy="true" batch-size="35" >
<id name="numeroContribuable" type="string">
<column name="NUMERO_CONTRIBUABLE" length="32" />
<generator class="assigned" />
</id>
<many-to-one name="pays" class="org.yournamehere.client.Pays" fetch="select">
<column name="CODE_PAYS" length="32" />
</many-to-one>
<many-to-one name="ville" class="org.yournamehere.client.Ville" fetch="select">
<column name="CODE_VILLE" length="32" />
</many-to-one>
<property name="nomAssure" type="string">
<column name="NOM_ASSURE" length="50" />
</property>
<property name="adresseAssure1" type="string">
<column name="ADRESSE_ASSURE1" length="50" />
</property>
<property name="adresseAssure2" type="string">
<column name="ADRESSE_ASSURE2" length="50" />
</property>
<property name="adresseAssure3" type="string">
<column name="ADRESSE_ASSURE3" length="50" />
</property>
<property name="boitePostale" type="java.lang.Long">
<column name="BOITE_POSTALE" precision="10" scale="0" />
</property>
<property name="indicatifPaysFixe" type="java.lang.Long">
<column name="INDICATIF_PAYS_FIXE" precision="10" scale="0" />
</property>
<property name="numeroFixe" type="big_decimal">
<column name="NUMERO_FIXE" precision="20" scale="0" />
</property>
<property name="indicatifPaysMobile" type="java.lang.Long">
<column name="INDICATIF_PAYS_MOBILE" precision="10" scale="0" />
</property>
<property name="numeroMobile" type="big_decimal">
<column name="NUMERO_MOBILE" precision="20" scale="0" />
</property>
<property name="indicatifPaysFax" type="java.lang.Long">
<column name="INDICATIF_PAYS_FAX" precision="10" scale="0" />
</property>
<property name="numeroFax" type="big_decimal">
<column name="NUMERO_FAX" precision="20" scale="0" />
</property>
<property name="emailAssure" type="string">
<column name="EMAIL_ASSURE" length="50" />
</property>
<set name="cmhs" inverse="true" >
<key>
<column name="NUMERO_CONTRIBUABLE" length="32" />
</key>
<one-to-many class="org.yournamehere.client.Cmh" />
</set>
</class>
</hibernate-mapping>
la base utilisé est oracle9i
le code hql
Code:
Session session= gileadHibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
// Criteria crit =session.createCriteria(Assure.class);
//crit.setMaxResults(50);
// List<Assure> assures = crit.list();
List assures = (session.createQuery(
"from Assure").list());
la requete sql est select assure0_.NUMERO_CONTRIBUABLE as col_0_0_ from CMH.ASSURE assure0_
est merci