Query q = sess.createQuery(
"select wo, rtr "
+ "from com.waterfind.core.WaterOffer wo, "
+ " com.waterfind.core.RegionTradingRelationship rtr "
+ "where rtr.toRegion.name = ? "
+ " and rtr.fromRegion = wo.sellingRegion "
+ " and (rtr.suspended is null or rtr.suspended = false) "
+ " and wo.buyer is null "
+ " and (wo.seller.userName != ? or wo.seller.userName is null) "
+ " and (rtr.sale = wo.sale or (rtr.sale is null and wo.sale) "
+ " or (wo.sale is null and rtr.sale)) "
+ " and (wo.deleted is null or wo.deleted = false) "
+ " and wo.startIrrigationSeason = ? "
+ " order by " + searchKey);
q.setString(0, regionName); q.setString(1, userId); q.setString(2, String.valueOf(StartYear));
Iterator iter = q.iterate();
Hello, whats wrong with this sql, it did work for hibernate 2.0x but now i change to version 3.0x and gives me an org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: .
|