Hello everybody,
I am a new user of hibernate. It works fine.
But now i m in problem.
I have a class:
SurveyDTO and another class SurveyLineDTO
SurveyDTO contains the collection of SurveyLineDTO.
The attribures of SurveyDTO are
surveyReportImportDate
reportDescription
...........................
and the attribues of SurveyLineDTO are
surveyDate
dirCode
doctorName
teritoryCode
productType
................
Here is my hbm.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<!-- Created by wasim on October 19, 2003, 10:21 AM -->
<hibernate-mapping>
<class name="com.mislbd.iris.marketing.survey.SurveyReportDTO" table="SurveyReport">
<!--<jcs-cache usage="read-write"/>-->
<id column="surveyReportId" name="id">
<generator class="increment"/>
</id>
<property name="surveyReportImportDate"/>
<property name="reportDescription"/>
<many-to-one name="surveyReportResponsible" class="com.mislbd.iris.mis.core.user.UserDTO" column="suveyreportresponsible" not-null="true"/>
<list name="surveyReportLines" table="SurveyReportLine" >
<key column="surveyReportId"/>
<index column="lineItemIndex"/>
<composite-element class="com.mislbd.iris.marketing.survey.SurveyReportLineDTO">
<property name="surveyDate"/>
<property name="dirCode"/>
<property name="doctorName"/>
<property name="auditType"/>
<property name="teritoryCode"/>
<property name="genericProductName"/>
<property name="companyName"/>
<property name="productType"/>
<property name="productStrength"/>
<property name="packType"/>
<property name="packSize"/>
<property name="packSizeUnit"/>
<property name="rxNo"/>
<property name="brand"/>
<property name="posnCode"/>
<property name="quantity"/>
<property name="value"/>
<property name="yearMonth"/>
</composite-element>
</list>
</class>
</hibernate-mapping>
Now i want write a HQL that could retrive the elements of surveyReportLines.
Here is a HQL
select elements(s.surveyReportLines) from SurveyReportDTO s
It gives as element. I need only some property of elements
pls help.
Regards
banik
banik@mislbd.com