mapping requete HQL et condition IN
Bonjour,
dans mon mapping, je voudrais passer une liste de valeur pour un paramètre => "and period_type in (:listPeriodType)"
et par exemple :listPeriodType recevrait un tableau ("1","2","3")
Est ce possible de faire ça ?
J'ai regardé dans la doc, mais je n'ai vu que des trucs du genre
"and period_type in ("1","2","3")"
et moi je voudrais paramétrer tout ça
voici le code du mapping :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sbe.persistance.entitesSQL.PlanningSociete">
<id name="datePlanning" type="string"/>
<property name="startTime1" type="string"/>
<property name="endTime1" type="string"/>
<property name="startTime2" type="string"/>
<property name="endTime2" type="string"/>
<property name="startTime3" type="string"/>
<property name="endTime3" type="string"/>
<property name="startTime4" type="string"/>
<property name="endTime4" type="string"/>
<property name="periodType" type="string"/>
</class>
<resultset name="planningResultSet">
<return alias="planning" class="com.sbe.persistance.entitesSQL.PlanningSociete">
<return-property name="datePlanning" column="datePlanning"/>
<return-property name="startTime1" column="startTime1"/>
<return-property name="endTime1" column="endTime1"/>
<return-property name="startTime2" column="startTime2"/>
<return-property name="endTime2" column="endTime2"/>
<return-property name="startTime3" column="startTime3"/>
<return-property name="endTime3" column="endTime3"/>
<return-property name="startTime4" column="startTime4"/>
<return-property name="endTime4" column="endTime4"/>
<return-property name="periodType" column="periodType"/>
</return>
</resultset>
<sql-query name="planningSociete" resultset-ref="planningResultSet">
select cld_jour.pjr_date,cld_sem.pjs_id,net.*
from network_planning_config net, cld_tr_jour_travail_semaine cld_sem, cld_t_jour cld_jour
where id_user = 0
and (id_compagny=:company or id_compagny =0)
and (id_agency=:agency or id_agency =0)
and period_type in (:listPeriodType)
and cld_sem.id_company=net.id_compagny
and nvl(net.week_day,cld_sem.pjs_id)=cld_sem.pjs_id
and cld_sem.pjs_id= cld_jour.pjs_id
and floor(cld_jour.pjr_rang_semaine)=(select floor(pjr_rang_semaine)
from sbedba.cld_t_jour
where pjr_date=trunc(sysdate))
</sql-query>
</hibernate-mapping> |
Merci de votre aide