Skip to content

Commit

Permalink
Merge pull request #9 from axelsean/master
Browse files Browse the repository at this point in the history
Updated min and max dates so that Oracle will work
  • Loading branch information
tennaito committed Jun 2, 2016
2 parents abcaab6 + b732f01 commit 2f9ab2c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.github.tennaito</groupId>
<artifactId>rsql-jpa</artifactId>
<version>2.0.6-SNAPSHOT</version>
<version>2.0.7-SNAPSHOT</version>
<packaging>jar</packaging>

<!--//////////////////// ABOUT ////////////////////-->
Expand Down Expand Up @@ -52,7 +52,7 @@
<version>2.0.0</version>
</dependency>

<!-- Unfortunately we don´t have a cannonical javax.persistence 2.1 yet -->
<!-- Unfortunately we don´t have a canonical javax.persistence 2.1 yet -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
Expand Down
15 changes: 13 additions & 2 deletions src/main/java/com/github/tennaito/rsql/jpa/PredicateBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,19 @@ public final class PredicateBuilder {

public static final Character LIKE_WILDCARD = '*';

private static final Date START_DATE = new Date(0L) ;
private static final Date END_DATE = new Date(99999999999999999L) ;
private static final Date START_DATE;
private static final Date END_DATE;

static {
//
// Use a date range that Oracle can cope with - apparently the years around 1 BC and 1 AD are messed up in Oracle - known bug
//
Calendar cal = Calendar.getInstance();
cal.set( 9999, Calendar.DECEMBER, 31);
END_DATE = cal.getTime();
cal.set( 5, Calendar.JANUARY, 1); // Use Jan 1, 5 AD, since that's where the Roman's sort of got it together with leap years.
START_DATE = cal.getTime();
}

/**
* Private constructor.
Expand Down

0 comments on commit 2f9ab2c

Please sign in to comment.