-->
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: Postgresql OVERLAPS(date, date) and Hibernate Filters
PostPosted: Fri Jun 08, 2007 5:21 pm 
Newbie

Joined: Fri Jun 08, 2007 4:55 pm
Posts: 2
hello all,

I am using hibernate 3.2 with PostgreSQL 8.2 and I am attempting to call the Postgres OVERLAPS operator from within a Filter condition.

Example

Code:
<filter
  name="withinInterval"
  condition="segment in ( select data_segment.id from data_segment where (data_segment.start_time, data_segment.stop_time) OVERLAPS (:start, :end))"
/>


The problem I am running into is that when the SQL is generated for a query using this filter, OVERLAPS is prefixed with this_. causing it to error out.

generated sql
Code:
where
(data_segment.start_time, data_segment.stop_time) this_.OVERLAPS (?, ?)


it fails at that point. what direction should i head with this? my first hunch is that it involves the postgres dialect. but i cant believe that date OVERLAPS is not being called by anyone other than me. :)

thanks for your time and help!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 11, 2007 11:26 am 
Newbie

Joined: Fri Jun 08, 2007 4:55 pm
Posts: 2
so i have determined that the OVERLAPS operator is not supported by the postgres dialect.

i have been attempting to add this operator to an extension of the pg dialect. but i cant seem to make it work.. my attempts have led me to this error
Code:
ERROR: function pg_catalog.overlaps(timestamp without time zone, timestamp without time zone, "unknown", "unknown") is not unique

the OVERLAPS operator description from the Postgres website
Quote:
(start1, end1) OVERLAPS (start2, end2)
(start1, length1) OVERLAPS (start2, length2)

This expression yields true when two time periods (defined by their endpoints) overlap, false when they do not overlap. The endpoints can be specified as pairs of dates, times, or time stamps; or as a date, time, or time stamp followed by an interval.

SELECT (DATE '2001-02-16', DATE '2001-12-21') OVERLAPS
(DATE '2001-10-30', DATE '2002-10-30');
Result: true
SELECT (DATE '2001-02-16', INTERVAL '100 days') OVERLAPS
(DATE '2001-10-30', DATE '2002-10-30');
Result: false

any ideas ?

thanks,

-x


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.