Package com.totvs.tjf.tenant.schema
Enum Database
- All Implemented Interfaces:
Serializable
,Comparable<Database>
,java.lang.constant.Constable
Map the database info supported by the tenant schema library.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionLookup for the database instance based on the given database name.org.springframework.jdbc.core.RowMapper<String>
Map the result set row to the schema name.SQL statement to discover all schemas in the database.abstract String
getSetSchemaStatement
(String schema) Build the set schema SQL statement for the given schema.Retrieves the list of system databases schemas.static Database
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 Details
-
POSTGRESQL
-
H2
-
MYSQL
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getListSchemaStatement
SQL statement to discover all schemas in the database.- Returns:
- SQL statement.
-
getListSchemaRowMapper
Map the result set row to the schema name.- Returns:
- schema name.
-
getSetSchemaStatement
Build the set schema SQL statement for the given schema.- Parameters:
schema
- na to be set.- Returns:
- Set schema SQL statement.
-
getSystemSchemas
Retrieves the list of system databases schemas.- Returns:
- list of schemas name.
-
fromName
Lookup for the database instance based on the given database name.Note: This lookup is case insensitive.
- Parameters:
name
- to lookup the database instance.- Returns:
- the database instance if find one, otherwise,
POSTGRESQL
as default.
-