-->
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.  [ 8 posts ] 
Author Message
 Post subject: strange hsql error : undefined alias: from
PostPosted: Fri Nov 21, 2003 12:26 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
I have this exception when I do the following query :

Code:

public IndexEditionValeur read(String numCle,Session session) throws HibernateException {
    IndexEditionValeur indexEditionValeur = null;
    IndexEditionPersistent indexEditionPersistent = null;
    IndexEditionTransform transformer = new IndexEditionTransform();

    try {
      String queryString = "select index from IndexEditionPersistent as index where index.cleIndex= :numCle";
      Query query = session.createQuery(queryString);
      query.setParameter("numCle",numCle);
      //query.setString("numCle",numCle) ;
      for(Iterator it = query.iterate(); it.hasNext(); ) {
        indexEditionValeur = transformer.persistentToValeur((IndexEditionPersistent ) it.next());
      }

.....


I think I should be damned ... I really don't understant what's happen !


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 12:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
show us the SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 12:45 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
gavin wrote:
show us the SQL.


i have only that from JCL :
Code:
17:42:47,796 DEBUG SessionImpl:1527 - iterate: SELECT index FROM IndexEditionPersistent AS index WHERE index.cleIndex= :numCle
17:42:47,796 DEBUG QueryParameters:93 - named parameters: {numCle=123456}
17:42:47,828 DEBUG QueryTranslator:149 - compiling query


I can't see the SQL an exception is raised before during the compilation of the query


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 12:50 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
So show us the stack trace then.

We do software development, not divination here....


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 1:12 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
gavin wrote:
So show us the stack trace then.

We do software development, not divination here....


Me to !

Code:
18:10:48,890 DEBUG DriverManagerConnectionProvider:84 - using pooled JDBC connection, pool size: 0
18:10:57,921 DEBUG SessionImpl:1527 - iterate: SELECT index FROM IndexEditionPersistent AS index WHERE index.cleIndex= :numCle
18:10:57,921 DEBUG QueryParameters:93 - named parameters: {numCle=123456}
18:10:57,953 DEBUG QueryTranslator:149 - compiling query
net.sf.hibernate.QueryException: undefined alias: FROM [SELECT index FROM fr.gouv.finances.dgi.opale.commun.transverse.persistent.IndexEditionPersistent AS index WHERE index.cleIndex= :numCle]
   at net.sf.hibernate.hql.PathExpressionParser.token(PathExpressionParser.java:102)
   at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
   at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:154)
   at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
   at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)
   at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143)
   at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
   at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:151)
   at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:140)
   at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:291)
   at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1501)
   at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1531)
   at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33)
   at fr.gouv.finances.dgi.opale.commun.domaine.metier.IndexEdition.read(IndexEdition.java:63)
   at fr.gouv.finances.dgi.opale.agent.domaine.metier.EditionMetier.rechercherCourierDemandeAdhesion(EditionMetier.java:114)
   at fr.gouv.finances.dgi.opale.agent.services.EditionServiceImpl.rechercherCourierDemandeAdhesion(EditionServiceImpl.java:112)
   at TestCnxDB.main(TestCnxDB.java:35)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 1:12 pm 
Newbie

Joined: Fri Oct 31, 2003 9:17 am
Posts: 10
Location: USA
Correct me if I'm wrong, but
Quote:
index
a reserved word on most DB systems.

_________________
Rich Herman


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 1:14 pm 
Newbie

Joined: Fri Oct 31, 2003 9:17 am
Posts: 10
Location: USA
Sorry abou the previous post. Index is a reserved word in most DB systems.

_________________
Rich Herman


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 1:20 pm 
Regular
Regular

Joined: Thu Nov 20, 2003 10:44 am
Posts: 58
Location: Paris, France
kinjaboy wrote:
Sorry abou the previous post. Index is a reserved word in most DB systems.


Yes you're right ... it is ok, thanks Rich


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

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.