Now I stepped over to sqlQuery since criteria didn't work.
When I change "%" in to "'%'" during debug the code runs through en I get a result.
Second run the code throws an error. When I change back to "%" the code runs through again. Second run it again trows error.
Is this a bug in hibernate? or am I just running a code that that is out of reach for hibernate?
Hibernate version:
2.1.8
Mapping documents:
Look at topic JDBC Exception
Code between sessionFactory.openSession() and session.close():
Code:
Query q = session.createSQLQuery("select {this.*}, DOMAIN.NAME from WORKMATE {this} inner join DOMAIN on {this}.DOMAIN_ID = DOMAIN.ID " +
"where " +
"{this}.LASTNAME like :lastname and " +
"{this}.FIRSTNAME like :firstname and " +
"{this}.IS_ACTIVE like :isActive and " +
"{this}.PPO_ID = :ppoId and " +
"{this}.DOMAIN_ID like :domainId"
, "this", Workmate.class);
q.setString("ppoId", workmate.getPpoId().toString());
q.setString("lastname", "%");
q.setString("firstname", "%");
q.setString("isActive", "%");
q.setString("domainId", "%");
Full stack trace of any exception that occurs:
[11:45:38,406] WARN JDBCExceptionReporter:57 - SQL Error: 1401, SQLState: 23000
[11:45:38,406] ERROR JDBCExceptionReporter:58 - ORA-01401: inserted value too large for column
[11:45:38,406] WARN JDBCExceptionReporter:57 - SQL Error: 1401, SQLState: 23000
[11:45:38,406] ERROR JDBCExceptionReporter:58 - ORA-01401: inserted value too large for column
[11:45:38,421] WARN JDBCExceptionReporter:57 - SQL Error: 1401, SQLState: 23000
[11:45:38,421] ERROR JDBCExceptionReporter:58 - ORA-01401: inserted value too large for column
[11:45:38,421] WARN JDBCExceptionReporter:57 - SQL Error: 1401, SQLState: 23000
[11:45:38,437] ERROR JDBCExceptionReporter:58 - ORA-01401: inserted value too large for column
[11:45:38,437] ERROR SessionImpl:2400 - Could not synchronize database state with session
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
Hibernate: update WORKMATE set PPO_ID=?, DOMAIN_ID=?, FIRSTNAME=?, MIDDLENAME=?,
LASTNAME=?, GENDER=?, DATE_OF_BIRTH=?, ZIPCODE_HOME=?, ZIPCODE_WORK=?, EDUCATIO
N=?, MARITAL_STATUS=?, IS_ACCEPTED=?, HAS_PROFILE=?, IS_ACTIVE=?, PROFILE=?, CRE
ATE_DATE=?, UPDATE_DATE=? where ID=?
Debug level Hibernate log excerpt: