Hi All,
Here are my datas :
The Mapping file :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="majpps.beans.Environnement" table="environnement" lazy="false">
<cache usage="read-only"/>
<id name="idEnv" column="IDENV" unsaved-value="any">
<generator class="sequence">
<param name="seq_environnement">seq_environnement</param>
</generator>
</id>
<discriminator column="TYPE_ENVIR" type="string"/>
<property name="nom">
<column name="NOM" sql-type="VARCHAR2(50)" not-null="true"/>
</property>
<subclass name="majpps.beans.EnvironnementPoste" lazy="false" discriminator-value="POSTE"
dynamic-update="true" dynamic-insert="true">
<property name="version">
<column name="VERSION" sql-type="VARCHAR2(50)" not-null="true"/>
</property>
<property name="code">
<column name="CODE" sql-type="VARCHAR2(50)" not-null="true"/>
</property>
</subclass>
<subclass name="majpps.beans.SolutionLecteur" lazy="false" discriminator-value="LECTEUR"
dynamic-update="true" dynamic-insert="true"/>
</class>
</hibernate-mapping>
The Classes :
Environnement is a JavaBean with 'nom' attribute and accessers.
EnvironnementPoste is a JavaBean with attributes 'version', 'code' and accessers, it extends Environnement.
SolutionPoste is a JavaBean with no attribute, it extends Environnement.
The DataBase (Oracle) :
A Table ENVIRONNEMENT with columns IDENV, TYPE_ENVIR, NOM, VERSION, CODE.
The HQL Query :
from Environnement
The result :
I have a query with only IDENV, CODE and VERSION columns inside... not NOM...
Why please ??
Thank you !! =)