Here is the exception - pastebin
Caused by: java.sql.SQLException: Unknown Parameter: 13
at com.google.cloud.sql.jdbc.ParameterMetadata.getParameterType(ParameterMetadata.java:45)
at org.hibernate.type.EnumType.nullSafeSet(EnumType.java:121)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:155)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2705)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2682)
at org.hibernate.persister.entity.AbstractEntityPersister$4.bindValues(AbstractEntityPersister.java:2863)
at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
... 111 more
Enum's in my hibernate mapping -
<property name="userStatus" column="user_status" insert="true" update="true" index="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.tutorial.enums.UserStatus</param>
<param name="type">12</param>
</type>
</property>
<property name="userType" column="user_type" insert="true" update="true" index="true">
<type name="org.hibernate.type.EnumType">
<param name="enumClass">com.tutorial.enums.UserType</param>
<param name="type">12</param>
</type>
</property>
My entity has UserType and UserStatus as enums. Hibernate is not able to convert enums properly. Should I switch back to hibernate 3 because in another project(with hibernate 3)I had my own custom type and it was working perfectly fine. I'm right now using hibernate 4.1.7.