-->
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.  [ 2 posts ] 
Author Message
 Post subject: dereferenced error while doing a HQL query
PostPosted: Mon Nov 07, 2005 5:49 am 
Hi,

I'm trying to write a very simple query like:

select o.Date.Value.Month from Order o

The Date property is a NullableDateTime, however, in the database, it actually never is null. I'm getting a deferenced error when executing this query.

Is the problem related with the fact that Value and Month are properties that don't appear in the mapping file?

Thanks,
Nuno


Top
  
 
 Post subject: Re: dereferenced error while doing a HQL query
PostPosted: Mon Nov 07, 2005 7:03 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
nuno wrote:
Is the problem related with the fact that Value and Month are properties that don't appear in the mapping file?


Yes.

HQL doesn't work by magic, it works by being translated to SQL, so try using some SQL function to get the month value from a date.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.