-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Exception saving enum fields
PostPosted: Mon Nov 05, 2012 12:43 am 
Newbie

Joined: Mon Nov 05, 2012 12:37 am
Posts: 1
This is the exception I'm getting

Code:
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


Full exception is here - http://pastebin.com/9sNVjeRQ

Here is my hibernate mapping for enums in the entity

Code:
<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>


I remove the enums from my entity then entity is getting persisted properly. Need help with this.
I've asked the same question here also. http://stackoverflow.com/questions/13191508/hibernate-unable-to-save-entity-with-one-of-the-fields-as-enum


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.