Hi all,
I am using hibernate through springframework. I post these problem to springframework forum too, but they send me here. I have just migrated from informix to oracle. I use fixedString="true" by oracle driver property.
Quote:
If the value of this property is "true", JDBC will use FIXED CHAR semantic when setObject is called with a String argument. By default JDBC uses VARCHAR semantics. The difference is in blank padding.
But now some hibernate queries doesn't work but if I use JdbcTemplate it works. Unfortunately I need use hibernate in some cases.
Small example:
Code:
public User getUserByLogin(String login) {
String queryString = "from " + User.class.getName() + " as user where user.login = ?";
HibernateTemplate temp = getHibernateTemplate();
List list = temp.find(queryString, login);
return (User) list.get(0);
}
but the list is empty, inspite of I am sure that login really exists.
If I use JdbcTemplate like this:
Code:
String queryString = " SELECT * from gusr where login = ?";
List list = getJdbcTemplate().queryForList(queryString, new Object[] {login});
returned list is OK, but then I cannot easily cast result to User object.
does anybody know what I am doing wrong?
thanks for your ideas
Hibernate version:3.0.5
Name and version of the database you are using: Oracle 10g