-->
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.  [ 4 posts ] 
Author Message
 Post subject: Null BIT column mapped to a boolean attribute
PostPosted: Wed Jun 14, 2006 10:03 am 
Newbie

Joined: Mon Jan 23, 2006 12:37 pm
Posts: 16
Hibernate version: 3.1.2

Code between sessionFactory.openSession() and session.close():

Session management carried out by Spring Framework

Full stack trace of any exception that occurs:

09:47:39 ERROR [org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:412)] Could not complete request
org.apache.jasper.JasperException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) sett
er of com.shawmut.model.project.bid.BidInvitation.setBidSubmitted
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)

Name and version of the database you are using:

MS SQL Server 2000


I have a BIT column that is mapped to a boolean attribute. This BIT column sometimes has <NULL> values in the record. Unfortunately i can not change the database schema. I know i can use Boolean attribute instead of boolean which would make the error go away in this case but i want to use booleans instead of the wrapper class.


I was hoping some one could give me some ideas to point me in the right direction. Do i need to implement a new Type? I can't imagine i'm the first to run into the situation.


Thanks in advance

Russ


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 12:05 pm 
Newbie

Joined: Mon Jan 23, 2006 12:37 pm
Posts: 16
Problem solved! Here's the solution:

<property name="bidSubmitted" column="Udf_Bid_Submitted" formula="CASE Udf_Bid_Submitted WHEN 0 THEN 0 WHEN 1 THEN 1 ELSE 0 END"/>

How do i give myself points? ;)


Russ


Top
 Profile  
 
 Post subject: I answer an another solution see the Post
PostPosted: Wed Jun 14, 2006 3:40 pm 
Newbie

Joined: Tue Jun 06, 2006 7:33 pm
Posts: 11
Hi,
I read the post from imchi maybe my solution could be resolve you problem...

See: the post
Quote:
Primitive field for nullable column

[url]
http://forum.hibernate.org/viewtopic.php?t=960762
[/url]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 14, 2006 3:59 pm 
Newbie

Joined: Mon Jan 23, 2006 12:37 pm
Posts: 16
Ahhhhhhh! I see what you did. Thats a good idea. I'll have to keep that in mind. Not sure which solution i feel more comfortable with.


Thanks for the help Stef-âne!


Russ


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

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.