-->
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.  [ 2 posts ] 
Author Message
 Post subject: SQL-exception when using the Criteria object
PostPosted: Tue Mar 02, 2004 5:23 pm 
Newbie

Joined: Tue Mar 02, 2004 5:16 pm
Posts: 2
Hello everybody,
I am somehow in a dead end I don't know how to resolve it. Any help would be highly appreciated. Many thanks.
Regards
Gallus

Here is the problem:
I have a User class, with two properties login and id.
Further I have a table repository_user with two columns, id and login.

Now I want to lookup a user with a specific login and retrieve a user object.
Here is the code:
Code:
Criteria criteria = hibSession.createCriteria(User.class);
criteria.add(Expression.eq("login",login));
criteria.setMaxResults(10);
criteria.setResultTransformer(Criteria.ROOT_ENTITY);
List users = criteria.list();


Unfortunately I always get the following SQL exception:
[WARN] JDBCExceptionReporter - -SQL Error: 904, SQLState: 42000
[ERROR] JDBCExceptionReporter - -ORA-00904: "THIS"."ID": invalid identifier

I could not figure out, where the "THIS" is coming from. Would anybody have an idea what I am doing wrong?

Please also find below my configuration
Code:
<hibernate-mapping package="com.valtech.repository.persistence" >
   <class
      name="com.valtech.repository.persistence.User"
      table="repository_user">
      <id name="id" type="int" column="id" >
         <generator class="sequence" >
            <param name="sequence">repositoryUser_seq</param>
         </generator>
      </id>
      
      <property
         name="login"
         column="login"
         type ="java.lang.String"
         update="true"
         insert="true"/>
         
      
   </class>
      
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 02, 2004 5:52 pm 
Newbie

Joined: Tue Mar 02, 2004 5:16 pm
Posts: 2
Sorry, for having used this group, I actually found the problem, my database column name was incorrect, I got a little bit distracted by the "THIS" in the error message.
Thanks
Gallus


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.