I'm using oracle 9i and H3 and when I send a select statement and return
an object using a transform like:
SQLQuery q = ses.createSQLQuery( select lata from
call_record where npa=:npa and nxx=:nxx );
q.setParameter( "npa", "800" );
q.setParameter( "nxx", "555" );
q.setResultTransformer( Transformers.aliasToBean(
LataResult.class ) );
List fromList = q.list();
it fails with:
org.hibernate.PropertyNotFoundException: Could not find setter for LATA
on class com.LataResult
However, when I change:
private Long lata;
To:
private Long LATA;
along with getters and setters to:
public Long getLATA() {
return LATA;
}
public void setLATA( Long lata ) {
LATA = lata;
}
Then it works. So it is not following Java accessor standards of mixed
case method names.
Jeff
this is actually a limitation of some databases which return alias all
uppercase instead of using the casing you actually specified.
I have had a fix for it for a while by introducing a
LenientPropertyAccessor to allow this to work for the case of
autodiscovery.
until then use .addScalar(..) to workaround it.
/max
On Feb 16, 2007, at 6:29 PM, Horan, Jeff wrote:
> Then it works. So it is not following Java accessor standards of mixed
> case method names.
FAQ. Go to the forum next time.
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev
--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
max(a)hibernate.org
http://hibernate.org
JBoss a division of Red Hat
max.andersen(a)jboss.com