-->
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: Filter is prefixing a keyword with THIS_, throwing sql error
PostPosted: Thu Jun 04, 2009 11:22 am 
Beginner
Beginner

Joined: Tue Mar 13, 2007 8:26 am
Posts: 25
Hello,

I've just made a Filter that needs to check only the first result of a subquery:
Code:
@Filter(
    name = "dataPrevisaoMaiorQue",
    condition = ":dataPrevisaoMinima <= (select first 1 coalesce(PC.DATA_PREV, CURRENT_DATE) " +
            "from PEDIDO PC " +
            "where PC.ID_DI = ID_DI " +
            "order by PC.DATA_PREV desc)"
)


The problem is that "first" and "CURRENT_DATE" are reserved keywords and hibernate is prefixing them with this_., and because of this prefix the db throws a "token unknow". This is the result sql generated by hibernate:
Code:
:dataPrevisaoMaiorQue.dataPrevisaoMinima >= (select this_.first 1 coalesce(PC.DATA_PREV, this_.CURRENT_DATE) from PEDIDO PC where PC.ID_DI = this_.ID_DI order by PC.DATA_PREV desc)


I'm using Firebird 2.1 and Hibernate 3.3.1. How could I tell to hibernate to no prefix the reserved keywords? Is this a bug?

Regards,

_________________
---
Felipe Marin Cypriano


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.