-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: GetNamedQuery - Error in named query - No persister for
PostPosted: Wed Jun 15, 2011 3:58 am 
Newbie

Joined: Mon Jul 09, 2007 4:35 am
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.