-->
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: migration from 2 to 3, bit operations
PostPosted: Tue Dec 05, 2006 9:23 am 
Newbie

Joined: Tue Dec 05, 2006 8:53 am
Posts: 1
Hi

On migration from Hibernate 2 to 3 I have a few problems while using the SQLQuery for bitwise operations. I have included the sql query I pass, and also the code for execution and retrieval. This worked in version 2 but does not in 3.2. I first want to chek that the query code (not the SQL statement) is correct, before looking for other reasons. All the mapping code is created using XDoclet, and worked before and appears to work now for everything else.

Any help would be greatly appreciated

Hibernate version: 3.2

The SQL (show_sql=true):

select o.* from order_header as o where (o.status & 1) = 1 and (o.status & 2) = 0 and (o.status & 32) = 0 and (o.status & 16) = 0 and (o.status & 1024) = 0 and (o.status & 64) = 0 and (o.status & 4096) = 0 and (o.status & 2048) = 0

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

List result = session.createSQLQuery(sql).addEntity("o", Order.class).list();
for (Iterator it = result.iterator(); it.hasNext();) {
Object[] row = (Object[]) it.next();
orders.add((Order) row[0]);
}

Full stack trace of any exception that occurs:

WARN 2006-12-05 12:56:24,173 JDBCExceptionReporter - SQL Error: 0, SQLState: S0022
ERROR 2006-12-05 12:56:24,173 JDBCExceptionReporter - Column 'id0_' not found.
ERROR 2006-12-05 12:56:24,175 OrderManager - problems finding orders
org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1420)
at org.hibernate.loader.Loader.list(Loader.java:1400)
at org.hibernate.loader.CustomLoader.list(CustomLoader.java:101)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1353) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:146)
at com.glide3.domain.core.order.OrderManager.findAllOrders(OrderManager.java:116)

Name and version of the database you are using:

MySql 4.2


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.