-->
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: BIT postgresql and JAVA Byte mapping issue
PostPosted: Mon Jan 18, 2010 1:38 pm 
Newbie

Joined: Tue Nov 17, 2009 1:45 pm
Posts: 4
Hello
I am facing some problems with BIT type of Postgresql. I googled the exception but cannot map out the solution.

Here is the column in table with is miscreant :P
Code:
TABLE public.defect
  ADD COLUMN is_rectification_required bit(30);

Here is the generated code for this column
Code:
private Byte isRectificationRequired;


when i try to insert a record i face the following exception. What is wrong with as i used hibernate to generate
Code:
ERROR [main] (JDBCExceptionReporter.java:78) - ERROR: column "is_rectification_required" is of type bit but expression is of type smallint
ERROR [main] (AbstractFlushingEventListener.java:301) - Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)



Please help me with this problem

Kind Regards
Shakeel Abbas


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.