This is the exception I am getting for scenario 2:
### Error querying database. Cause:
org.apache.ibatis.executor.ExecutorException: No type handler could be found to
map the property 'password' to the column 'PASSWORD'. One or both of the
types, or the combination of types is not supported.
### The error may exist in com/test/test/db/config/User.xml
### The error may involve User.UserResult
### The error occurred while handling result set
### SQL: SELECT * FROM user WHERE oid = ?
### Cause: org.apache.ibatis.executor.ExecutorException: No type handler could
be found to map the property 'password' to the column 'PASSWORD'. One or both
of the types, or the combination of types is not supported.
org.apache.ibatis.exceptions.IbatisException:
### Error querying database. Cause:
org.apache.ibatis.executor.ExecutorException: No type handler could be found to
map the property 'password' to the column 'PASSWORD'. One or both of the
types, or the combination of types is not supported.
### The error may exist in com/test/test/db/config/User.xml
### The error may involve User.UserResult
### The error occurred while handling result set
### SQL: SELECT * FROM user WHERE oid = ?
### Cause: org.apache.ibatis.executor.ExecutorException: No type handler could
be found to map the property 'password' to the column 'PASSWORD'. One or both
of the types, or the combination of types is not supported.
at
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:52)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:44)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:32)
From: [email protected]
To: [email protected]
Subject: IBatis 3 backward compatibility
Date: Sat, 22 Aug 2009 23:47:07 +0000
Hi,
I found two scenario's in which used to work in ibatis 2 but no longer works in
ibatis 3.
Scenario 1:
In ibatis 2, you could specify the table name and column name:
e.g.
<result column="user.version" jdbcType="INTEGER" property="version" />
In this case the table is "user" and the column is "version"
With Ibatis 3, if I specify the full column name, "user.version", pojo binding
doesn't occur. I must omit the "user." part to just
<result column="version" jdbcType="INTEGER" property="version" />
The ability to have the fully qualified column name is important when you need
to distinguish them when both columns are selected from the database.
e.g.
<result column="user.version" jdbcType="INTEGER" property="version" />
<result column="place.version" jdbcType="INTEGER" property="version" />
Of course there I could change the column names so they are unique across all
tables or use aliasing when necessary. But I thought the ibatis 2 approach was
cleaner
Scenario 2:
In ibatis 2, I used to be able to access a pojo property that is complex:
e.g.
<result column="password" property="password.encrypted" jdbcType="VARCHAR" />
So I had a Field of type Password which had and encrypted member. I only want
to persist "encrypted"
class Pojo{
private Password password;
}
class Password{
private String encrypted; //the encrypted string
public void getDecryptedString(){...}
}
Windows Live: Make it easier for your friends to see what you’re up to on
Facebook. Find out more.
_________________________________________________________________
Hotmail® is up to 70% faster. Now good news travels really fast.
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009