- 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()
Name
toName()
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
@NotNull @Support public static final DatePart YEAR
The year. Corresponds toChronoField.YEAR
semantics.
-
MONTH
@NotNull @Support public static final DatePart MONTH
The month. Corresponds toChronoField.MONTH_OF_YEAR
semantics.
-
DAY
@NotNull @Support public static final DatePart DAY
The day. Corresponds toChronoField.DAY_OF_MONTH
semantics.
-
HOUR
@NotNull @Support public static final DatePart HOUR
The hour. Corresponds toChronoField.HOUR_OF_DAY
semantics.
-
MINUTE
@NotNull @Support public static final DatePart MINUTE
The minute. Corresponds toChronoField.MINUTE_OF_HOUR
semantics.
-
SECOND
@NotNull @Support public static final DatePart SECOND
The second. Corresponds toChronoField.SECOND_OF_MINUTE
semantics.
-
MILLISECOND
@NotNull @Support({AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HSQLDB,POSTGRES,SQLSERVER}) public static final DatePart MILLISECOND
The millisecond.
-
MICROSECOND
@NotNull @Support({AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HSQLDB,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLSERVER}) public static final DatePart MICROSECOND
The microsecond.
-
NANOSECOND
@NotNull @Support({H2,HSQLDB,SQLSERVER}) public static final DatePart NANOSECOND
The nanosecond.
-
MILLENNIUM
@NotNull @Support public static final DatePart MILLENNIUM
The millennium. The year 2000 is in the 2nd millennium, the year 2001 in the 3rd.
-
CENTURY
@NotNull @Support public static final DatePart CENTURY
The century. The year 2000 is in the 20th century, the year 2001 in the 21st.
-
EPOCH
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE}) public static final DatePart EPOCH
The epoch in seconds since 1970-01-01.
-
QUARTER
@NotNull @Support public static final DatePart QUARTER
The quarter. Jan-Mar = 1, Apr-Jun = 2, Jul-Sep = 3, Oct-Dec = 4.
-
WEEK
@NotNull @Support({AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2_11,H2,HANA,HSQLDB,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES}) public static final DatePart WEEK
The week of the year.
-
DAY_OF_YEAR
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,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
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,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
@NotNull @Support({ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,DB2,H2,HANA,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
@NotNull @Support({AURORA_POSTGRES,H2,HSQLDB,POSTGRES}) public static final DatePart TIMEZONE
The timezone offset in seconds. Corresponds toChronoField.OFFSET_SECONDS
.
-
TIMEZONE_HOUR
@NotNull @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()
-
toName
public final Name toName()
-
-