Enum Database
- java.lang.Object
- java.lang.Enum<Database>
- org.springframework.orm.jpa.vendor.Database
- All Implemented Interfaces:
Serializable
,Comparable<Database>
public enum Database extends Enum<Database>
Enumeration for common database platforms. Allows strong typing of database type and portable configuration between JpaVendorDialect implementations.If a given PersistenceProvider supports a database not listed here, the strategy class can still be specified using the fully-qualified class name. This enumeration is merely a convenience. The database products listed here are the same as those explicitly supported for Spring JDBC exception translation in
sql-error-codes.xml
.- Since:
- 2.0
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
AbstractJpaVendorAdapter.setDatabase(org.springframework.orm.jpa.vendor.Database)
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Database
valueOf(String name)
Returns the enum constant of this type with the specified name.static Database[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Detail
POSTGRESQL
public static final Database POSTGRESQL
SQL_SERVER
public static final Database SQL_SERVER
Method Detail
values
public static Database[] 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 (Database c : Database.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
public static Database 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