Hello,
I defined the following named query in a hbm.xml file.
Code:
<import class="Aedra.Modele.AedraIntervalle, Modele"/>
<sql-query name="GetDefaultIntervalle" callable="true">
<return class="Aedra.Modele.AedraIntervalle, Modele"/>
<![CDATA[
select
new AedraIntervalle(sd.num_semaine, sd.exercice)
from
semaines_diffusion sd
where
((sysdate between date_debut and date_fin )
or (sysdate + 7 between date_debut and date_fin )
or ((sysdate + 14 between date_debut and date_fin )))
order
by date_debut asc
]]>
</sql-query>
and the AedraIntervalle class is defined as :
Code:
namespace Aedra.Modele
{
public class AedraIntervalle
{
public int NumWeek { get; set; }
public int Exercice { get; set; }
public override bool Equals(object obj)
{
if (obj == null) return false;
if (ReferenceEquals(obj,this)) return true;
if (obj is AedraIntervalle)
{
AedraIntervalle that = (AedraIntervalle)this;
return (that.NumWeek == NumWeek && that.Exercice == Exercice);
}
return false;
}
public override int GetHashCode()
{
return NumWeek.GetHashCode() + Exercice.GetHashCode();
}
public AedraIntervalle(int aNumWeek, int aExercice)
{
NumWeek = aNumWeek;
Exercice = aExercice;
}
}
}
But I get the error :
Error in named query : GetDefaultIntervalle
No persister for : Aedra.Modele.AedraIntervalle
All my hbm.xml are Embeded and all others query and mapping in the same hbm file seems to be ok.
The class is public.
I try to set fully qualified class name or not but nothing to do.
Can you please tell me what is wrong ?
Best regards