ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin" <clinton.be...@gmail.com>
Subject RE: Unknown Column Name problem
Date Tue, 09 Oct 2007 13:55:45 GMT
I'm REALLY surprised iBATIS isn't telling you which result mapping is
causing the problem.  It almost always reports this.  For example, I just
purposely changed one of my mappings to imitate an invalid column problem:

 

If the property name is incorrect, it should fail upon initialization with:

 

Caused by: com.ibatis.common.beans.ProbeException: There is no WRITEABLE
property named 'xdescription' in class 'org.xxxxxx.facebook.domain.Gift'

 

If the column name is incorrect, it should fail with this:

 

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   

--- The error occurred in org/xxxxxxxx/facebook/data/sql/Gift.xml.  

--- The error occurred while applying a result map.  

--- Check the Gift.GiftResult.  

--- Check the result mapping for the 'description' property.  

--- Cause: java.sql.SQLException: Column 'xdescription' not found.

 

Cheers,

Clinton

 

From: Rinaldo Bonazzo [mailto:rbonazzo@sardiniapoint.it] 
Sent: October-09-07 2:34 AM
To: user-java@ibatis.apache.org
Subject: Re: Unknown Column Name problem

 

Claus Hausberger ha scritto: 

I currently do not have access to the sources because I am not in the
office, but what you write is exactly my problem.
do I always have to specify all column names in the query that are also in
the ResultMap ?
  

Yes



currently there are seven columns mentionned in the ResultMap and when I
specify all seven or when I use "Select *" it works, but when I specify only
two or three it does not work.
 
best wishes
 
Claus
 
  

Could you post your Select that causes error and ResultMap?
 
If you omit column that's present in the ReusltMap I guess you'll get
invalid column name exception...
    

 
  

 


Mime
View raw message