Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql

public final Enum JPAVersion

extends Enum<JPAVersion>
Class Inheritance

An enumeration listing the various releases of the Java Persistence specification.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Author
Pascal Filion

Field Summary

Modifier and TypeField and Description
public static final JPAVersion
DEFAULT_VERSION

The constant for the default version used by the parsing system, which is always the latest version of the Java Persistence functional specification, which is version 2.0.

private final double
version

The real version number.

public static final JPAVersion
VERSION_1_0

The constant for the Java Persistence specification 1.0.

public static final JPAVersion
VERSION_2_0

The constant for the Java Persistence specification 2.0.

public static final JPAVersion
VERSION_2_1

The constant for the Java Persistence specification 2.1.

public static final JPAVersion
VERSION_2_2

The constant for the Java Persistence specification 2.2.

public static final JPAVersion
VERSION_3_0

The constant for the Jakarta Persistence specification 3.0.

public static final JPAVersion
VERSION_3_1

The constant for the Jakarta Persistence specification 3.1.

Constructor Summary

AccessConstructor and Description
private
JPAVersion(double
The actual version number
version
)

Creates a new JPAVersion.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The string value of the version
getVersion
()

Returns the real version this constant represents.

public boolean

Returns:

true if this constant represents a newer version and the given constant represents a version that is older; false if the given constant represents a newer and this constant represents an older version
isNewerThan
(JPAVersion
The constant to verify if it's representing a version that is older than this one
version
)

Determines whether this constant represents a version that is newer than the given version.

public boolean

Returns:

true if this constant represents a newer version and the given constant represents a version that is older or if it's the same constant; false if the given constant represents a newer and this constant represents an older version
isNewerThanOrEqual
(JPAVersion
The constant to verify if it's representing a version that is older than this one or if it's the same than this one
version
)

Determines whether this constant represents a version that is newer than the given version or if it's the same version.

public boolean

Returns:

true if this constant represents an earlier version and the given constant represents a version that is more recent; false if the given constant represents an earlier version and this constant represents a more recent version
isOlderThan
(JPAVersion
The constant to verify if it's representing a version that is more recent than this one
version
)

Determines whether this constant represents a version that is older than the given version.

public boolean

Returns:

true if this constant represents an earlier version and the given constant represents a version that is more recent or if it's the same constant; false if the given constant represents an earlier version and this constant represents a more recent version
isOlderThanOrEqual
(JPAVersion
The constant to verify if it's representing a version that is more recent than this one or if it's the same than this one
version
)

Determines whether this constant represents a version that is older than the given version or if it's the same version.

public JPAVersion

Returns:

Either this same constant or the actual version constant
toCurrentVersion
()

Converts the current constant to one of the known versions, this means if the constant is DEFAULT_VERSION, then it will be converted into the actual constant representing that version.

public String
toString()

Overrides java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration.
public static JPAVersion

Returns:

The constant version of the given value
value
(String
The value to retrieve its constant version
value
)

Retrieves the enumeration constant for the given value.

public static JPAVersion
public static JPAVersion[]
public static JPAVersion[]

Returns:

The list of unique constants
versions
()

Returns the list of JPAVersion excluding DEFAULT_VERSION.

Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinalvalueOf

Field Detail

DEFAULT_VERSIONback to summary
public static final JPAVersion DEFAULT_VERSION

The constant for the default version used by the parsing system, which is always the latest version of the Java Persistence functional specification, which is version 2.0.

versionback to summary
private final double version

The real version number.

VERSION_1_0back to summary
public static final JPAVersion VERSION_1_0

The constant for the Java Persistence specification 1.0.

VERSION_2_0back to summary
public static final JPAVersion VERSION_2_0

The constant for the Java Persistence specification 2.0.

VERSION_2_1back to summary
public static final JPAVersion VERSION_2_1

The constant for the Java Persistence specification 2.1.

VERSION_2_2back to summary
public static final JPAVersion VERSION_2_2

The constant for the Java Persistence specification 2.2.

VERSION_3_0back to summary
public static final JPAVersion VERSION_3_0

The constant for the Jakarta Persistence specification 3.0.

VERSION_3_1back to summary
public static final JPAVersion VERSION_3_1

The constant for the Jakarta Persistence specification 3.1.

Constructor Detail

JPAVersionback to summary
private JPAVersion(double version)

Creates a new JPAVersion.

Parameters
version:double

The actual version number

Method Detail

getVersionback to summary
public String getVersion()

Returns the real version this constant represents.

Returns:String

The string value of the version

isNewerThanback to summary
public boolean isNewerThan(JPAVersion version)

Determines whether this constant represents a version that is newer than the given version.

Parameters
version:JPAVersion

The constant to verify if it's representing a version that is older than this one

Returns:boolean

true if this constant represents a newer version and the given constant represents a version that is older; false if the given constant represents a newer and this constant represents an older version

isNewerThanOrEqualback to summary
public boolean isNewerThanOrEqual(JPAVersion version)

Determines whether this constant represents a version that is newer than the given version or if it's the same version.

Parameters
version:JPAVersion

The constant to verify if it's representing a version that is older than this one or if it's the same than this one

Returns:boolean

true if this constant represents a newer version and the given constant represents a version that is older or if it's the same constant; false if the given constant represents a newer and this constant represents an older version

isOlderThanback to summary
public boolean isOlderThan(JPAVersion version)

Determines whether this constant represents a version that is older than the given version.

Parameters
version:JPAVersion

The constant to verify if it's representing a version that is more recent than this one

Returns:boolean

true if this constant represents an earlier version and the given constant represents a version that is more recent; false if the given constant represents an earlier version and this constant represents a more recent version

isOlderThanOrEqualback to summary
public boolean isOlderThanOrEqual(JPAVersion version)

Determines whether this constant represents a version that is older than the given version or if it's the same version.

Parameters
version:JPAVersion

The constant to verify if it's representing a version that is more recent than this one or if it's the same than this one

Returns:boolean

true if this constant represents an earlier version and the given constant represents a version that is more recent or if it's the same constant; false if the given constant represents an earlier version and this constant represents a more recent version

toCurrentVersionback to summary
public JPAVersion toCurrentVersion()

Converts the current constant to one of the known versions, this means if the constant is DEFAULT_VERSION, then it will be converted into the actual constant representing that version.

Returns:JPAVersion

Either this same constant or the actual version constant

toStringback to summary
public String toString()

Overrides java.lang.Enum.toString.

Doc from java.lang.Enum.toString.

Returns the name of this enum constant, as contained in the declaration. This method may be overridden, though it typically isn't necessary or desirable. An enum class should override this method when a more "programmer-friendly" string form exists.

Returns:String

the name of this enum constant

Annotations
@Override
valueback to summary
public static JPAVersion value(String value)

Retrieves the enumeration constant for the given value. If the value is not known, then DEFAULT_VERSION will be returned.

Parameters
value:String

The value to retrieve its constant version

Returns:JPAVersion

The constant version of the given value

valueOfback to summary
public static JPAVersion valueOf(String name)
valuesback to summary
public static JPAVersion[] values()
versionsback to summary
public static JPAVersion[] versions()

Returns the list of JPAVersion excluding DEFAULT_VERSION.

Returns:JPAVersion[]

The list of unique constants