-->
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: Can't find getter method when using SELECT [Struts]
PostPosted: Tue May 24, 2005 10:05 am 
Newbie

Joined: Tue May 17, 2005 4:54 am
Posts: 15
Location: Germany, Karlsruhe
Hi,

I just cannot understand what's wrong here, so maybe you know some advise.
This error refers to both Apache Struts and Hibernate.

I have the following to easy queries:

(1) session.createQuery("FROM Person").list();
(2) session.createQuery(SELECT p.nachname FROM Person p).list();


"nachname" is declared in my mapping file and there is a getter/setter method for this property.

First of all, both queries don't make problems within hibernate itself and debugging has shown that it really returns result sets.

However, if I use (2) SELECT-statement, I always get the following error message:

No getter method for property nachname of bean xxx


But there is such a getter! And as mentioned, the version (1) does work without any problems.


Mapping documents:

from Person.hbm.xml:
.
.
.
<property name="nachname" column="nachname" type="java.lang.String" not-null="true" />
.
.
.

Name and version of the database you are using:
PostgreSQL 7.4

The generated SQL (show_sql=true):
select person0_.nachname as x0_0_ from personen person0_



Thanks for all of you who can help,

Georg


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 4:10 am 
Newbie

Joined: Tue May 17, 2005 4:54 am
Posts: 15
Location: Germany, Karlsruhe
Got it now.
One has to iterator over the object list.

--> see Ch. 11, "Iterating over tuples" in the documentation.


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.