Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1.3 and 3.2cr
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
java.lang.NullPointerException
at org.hibernate.type.PrimitiveType.toString(PrimitiveType.java:15)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:87)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
at org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:261)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1910)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1887)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2117)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2503)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:51)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:988)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:337)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at org.hibernate.auction.Main.createTestAuctions(Main.java:349)
at org.hibernate.auction.Main.main(Main.java:370)
Exception in thread "main"
Name and version of the database you are using:
Oracle 9.0.2
The generated SQL (show_sql=true):
Hibernate:
insert
into
AuctionUser
(userName, "password", email, firstName, "initial", lastName, id)
values
(?, ?, ?, ?, ?, ?, ?)
Debug level Hibernate log excerpt:
Problem is that PrimitiveType breaks when attempting to log the RuntimeException.
From NullableType.java, line 87 ;-
catch ( RuntimeException re ) {
log().info( "could not bind value '" + toString( value ) + "' to parameter: " + index + "; " + re.getMessage() );
throw re;
}
The PrimitiveType.toString method is ;-
public String toString(Object value) {
return value.toString();
}
and will not break if amended to ;-
public String toString(Object value) {
return String.valueOf(value);
}
I have searched JIRA etc. and the closest that I could find was HHH-1366
(I am a Hibernate newbie ).
TIA