-->
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: help about bitwise logical operation in hsql
PostPosted: Mon Dec 26, 2005 11:20 pm 
Newbie

Joined: Mon Dec 26, 2005 11:05 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

Mapping documents:3.0.5

My Sql Statement:
Code:
SELECT reservation.reserve_year AS business_year,
              reservation.reserve_month AS business_month,
              reservation.reserve_day AS business_day, '##' AS table_state,
              reservation.reservation_num AS bill_num, reservation_type AS bill_type,
              reservation_detail.table_num AS table_num,
              reserve_cust_count AS cust_count, reservation.reverve_time AS action_time,
              reservation.period_num AS period_num,
              reservation_detail.state_name AS state_name,
              reservation_detail.state_code AS state_code
        FROM reservation INNER JOIN
              reservation_detail ON
              reservation.reservation_num = reservation_detail.reservation_num
        WHERE (reservation_detail.state_code & 2 ^ 2 = 0) AND
              (reservation_detail.state_code & 4 ^ 4 <> 0) AND
              (reservation_detail.state_code & 8 ^ 8 <> 0) AND
              (reservation_detail.state_code & 16 ^ 16 <> 0))


but i don't know how to mapping corresponding hsq, the statement "reservation_detail.state_code & 2 ^ 2 = 0" how to write in hql, i try to write "r.state.stateCode & 4 ^ 4 = 0", but hibernate throws exception "org.springframework.orm.hibernate3.HibernateQueryException: unexpected char: '&'"

has anyone know about the question, thanks.


Full stack trace of any exception that occurs:


Top
 Profile  
 
 Post subject: HHH-160
PostPosted: Tue Dec 27, 2005 1:24 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please look at this open H bug:
http://opensource2.atlassian.com/projec ... se/HHH-160
there is a suggested workaround

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: sql
PostPosted: Tue Dec 27, 2005 1:26 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
And of course you can continue to use the SQL
http://www.hibernate.org/hib_docs/v3/re ... l-creating

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 10:19 am 
Newbie

Joined: Mon Dec 26, 2005 11:05 pm
Posts: 2
Thanks.

I am using Sql Server 2000. it looks there is only way using Native SQL method but define a SQLFunctionTemplate on a Dialect subclass.

is there any plan to fix the bug?


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.