- java.lang.Object
-
- java.lang.Enum<DatePart>
-
- org.jooq.DatePart
-
- All Implemented Interfaces:
Serializable
,Comparable<DatePart>
public enum DatePart extends Enum<DatePart>
A date part can be used with SQL functions such as extract(). It describes a part of a date / datetime value- Author:
- Lukas Eder
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTURY
The century.DAY
The day.DAY_OF_WEEK
The day of the week.DAY_OF_YEAR
The day of the year.DECADE
The decade.EPOCH
The epoch in seconds since 1970-01-01.HOUR
The hour.ISO_DAY_OF_WEEK
The ISO day of the week.MICROSECOND
The microsecond.MILLENNIUM
The millennium.MILLISECOND
The millisecond.MINUTE
The minute.MONTH
The month.NANOSECOND
The nanosecond.QUARTER
The quarter.SECOND
The second.TIMEZONE
The timezone offset in seconds.TIMEZONE_HOUR
The time zone offset's hour part.TIMEZONE_MINUTE
The time zone offset's minute part.WEEK
The week of the year.YEAR
The year.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Keyword
toKeyword()
String
toSQL()
static DatePart
valueOf(String name)
Returns the enum constant of this type with the specified name.static DatePart[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
YEAR
@Support public static final DatePart YEAR
The year. Corresponds toChronoField.YEAR
semantics.
-
MONTH
@Support public static final DatePart MONTH
The month. Corresponds toChronoField.MONTH_OF_YEAR
semantics.
-
DAY
@Support public static final DatePart DAY
The day. Corresponds toChronoField.DAY_OF_MONTH
semantics.
-
HOUR
@Support public static final DatePart HOUR
The hour. Corresponds toChronoField.HOUR_OF_DAY
semantics.
-
MINUTE
@Support public static final DatePart MINUTE
The minute. Corresponds toChronoField.MINUTE_OF_HOUR
semantics.
-
SECOND
@Support public static final DatePart SECOND
The second. Corresponds toChronoField.SECOND_OF_MINUTE
semantics.
-
MILLISECOND
@Support({H2,HSQLDB,SQLSERVER}) public static final DatePart MILLISECOND
The millisecond.
-
MICROSECOND
@Support({H2,HSQLDB,SQLSERVER}) public static final DatePart MICROSECOND
The microsecond.
-
MILLENNIUM
@Support public static final DatePart MILLENNIUM
The millennium. The year 2000 is in the 2nd millennium, the year 2001 in the 3rd.
-
CENTURY
@Support public static final DatePart CENTURY
The century. The year 2000 is in the 20th century, the year 2001 in the 21st.
-
EPOCH
@Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart EPOCH
The epoch in seconds since 1970-01-01.
-
QUARTER
@Support public static final DatePart QUARTER
The quarter. Jan-Mar = 1, Apr-Jun = 2, Jul-Sep = 3, Oct-Dec = 4.
-
WEEK
@Support({AURORA_POSTGRES,H2,HSQLDB,ORACLE,POSTGRES}) public static final DatePart WEEK
The week of the year.
-
DAY_OF_YEAR
@Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,DB2,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart DAY_OF_YEAR
The day of the year. Corresponds toChronoField.DAY_OF_YEAR
.
-
DAY_OF_WEEK
@Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,DB2,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart DAY_OF_WEEK
The day of the week. 1 = Sunday, 2 = Monday, ..., 7 = Saturday. Corresponds toChronoField.DAY_OF_WEEK
, shifted by one day.
-
ISO_DAY_OF_WEEK
@Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,DB2,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart ISO_DAY_OF_WEEK
The ISO day of the week. 1 = Monday, 2 = Tuesday, ..., 7 = Sunday. Corresponds toChronoField.DAY_OF_WEEK
.
-
TIMEZONE
@Support({AURORA_POSTGRES,H2,HSQLDB,POSTGRES}) public static final DatePart TIMEZONE
The timezone offset in seconds. Corresponds toChronoField.OFFSET_SECONDS
.
-
TIMEZONE_HOUR
@Support({AURORA_POSTGRES,H2,HSQLDB,POSTGRES}) public static final DatePart TIMEZONE_HOUR
The time zone offset's hour part.
-
-
Method Detail
-
values
public static DatePart[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DatePart c : DatePart.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DatePart valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
toSQL
public final String toSQL()
-
toKeyword
public final Keyword toKeyword()
-
-