org.jooq.util.postgres
Class PGIntervalConverter

java.lang.Object
  extended by org.jooq.util.postgres.PGIntervalConverter

public class PGIntervalConverter
extends Object

A converter for org.postgresql.util.PGInterval

Postgres returns an undisclosed internal type for intervals. This converter takes care of converting the internal type to jOOQ's interval data types DayToSecond and YearToMonth

Note, that Postgres uses some non-standard ways of describing negative intervals. Negative intervals have a sign before every date part!

Author:
Lukas Eder

Constructor Summary
PGIntervalConverter()
           
 
Method Summary
static DayToSecond toDayToSecond(Object pgInterval)
          Convert a Postgres interval to a jOOQ DAY TO SECOND interval
static Object toPGInterval(DayToSecond interval)
          Convert a jOOQ DAY TO SECOND interval to a Postgres representation
static Object toPGInterval(YearToMonth interval)
          Convert a jOOQ YEAR TO MONTH interval to a Postgres representation
static YearToMonth toYearToMonth(Object pgInterval)
          Convert a Postgres interval to a jOOQ YEAR TO MONTH interval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PGIntervalConverter

public PGIntervalConverter()
Method Detail

toPGInterval

public static Object toPGInterval(DayToSecond interval)
Convert a jOOQ DAY TO SECOND interval to a Postgres representation


toPGInterval

public static Object toPGInterval(YearToMonth interval)
Convert a jOOQ YEAR TO MONTH interval to a Postgres representation


toDayToSecond

public static DayToSecond toDayToSecond(Object pgInterval)
Convert a Postgres interval to a jOOQ DAY TO SECOND interval


toYearToMonth

public static YearToMonth toYearToMonth(Object pgInterval)
Convert a Postgres interval to a jOOQ YEAR TO MONTH interval



Copyright © 2012. All Rights Reserved.