Class PlatformHsqldbImpl
- java.lang.Object
-
- org.apache.torque.templates.platform.PlatformDefaultImpl
-
- org.apache.torque.templates.platform.PlatformHsqldbImpl
-
- All Implemented Interfaces:
Platform
public class PlatformHsqldbImpl extends PlatformDefaultImpl
HSQLDB (formerly known as Hypersonic) Platform implementation.- Version:
- $Id: PlatformHsqldbImpl.java 1896195 2021-12-20 17:41:20Z gk $
- Author:
- Martin Poeschl
-
-
Constructor Summary
Constructors Constructor Description PlatformHsqldbImpl()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
createNotNullBeforeAutoincrement()
Returns whether the "not null part" of the definition of a column should be generated before the "autoincrement part" in a "create table" statement.protected boolean
escapeBackslashes()
Returns whether backslashes must be escaped in string literals.String
getAutoIncrement()
String
getDateString(Date date)
Formats the given date as date string which is parseable by the database.String
getTimeString(Date date)
Formats the given date as time string which is parseable by the database.boolean
hasScale(String sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.boolean
hasSize(String sqlType)
Caveat, read HSQLDB e.g.boolean
usesStandaloneSchema()
Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.-
Methods inherited from class org.apache.torque.templates.platform.PlatformDefaultImpl
formatDateTimeString, getNullString, getSizeSuffix, getSqlTypeForSchemaType, getTimestampString, hasUniqueConstraintSize, quoteAndEscape, setSchemaTypeToSqlTypeMapping
-
-
-
-
Method Detail
-
getAutoIncrement
public String getAutoIncrement()
- Specified by:
getAutoIncrement
in interfacePlatform
- Overrides:
getAutoIncrement
in classPlatformDefaultImpl
- Returns:
- The RDBMS-specific SQL fragment for autoincrement.
- See Also:
Platform.getAutoIncrement()
-
createNotNullBeforeAutoincrement
public boolean createNotNullBeforeAutoincrement()
Returns whether the "not null part" of the definition of a column should be generated before the "autoincrement part" in a "create table" statement.- Specified by:
createNotNullBeforeAutoincrement
in interfacePlatform
- Overrides:
createNotNullBeforeAutoincrement
in classPlatformDefaultImpl
- Returns:
- false.
- See Also:
Platform.createNotNullBeforeAutoincrement()
-
escapeBackslashes
protected boolean escapeBackslashes()
Description copied from class:PlatformDefaultImpl
Returns whether backslashes must be escaped in string literals.- Overrides:
escapeBackslashes
in classPlatformDefaultImpl
- Returns:
- true if backslashes bust be escaped, false otherwise.
-
getDateString
public String getDateString(Date date)
Formats the given date as date string which is parseable by the database.- Specified by:
getDateString
in interfacePlatform
- Overrides:
getDateString
in classPlatformDefaultImpl
- Parameters:
date
- the date to format.- Returns:
- the date string, inclusive string escaping.
-
getTimeString
public String getTimeString(Date date)
Formats the given date as time string which is parseable by the database.- Specified by:
getTimeString
in interfacePlatform
- Overrides:
getTimeString
in classPlatformDefaultImpl
- Parameters:
date
- the date to format.- Returns:
- the time string, inclusive string escaping.
-
usesStandaloneSchema
public boolean usesStandaloneSchema()
Returns whether the database has schema support where a schema is not tied to a user (oracle) or database (mysql), but can be created separately.- Specified by:
usesStandaloneSchema
in interfacePlatform
- Overrides:
usesStandaloneSchema
in classPlatformDefaultImpl
- Returns:
- this implementation returns true.
-
hasSize
public boolean hasSize(String sqlType)
Caveat, read HSQLDB e.g. Do not use BINARY(L) unless you are storing keys such as UUID. This type pads short binary strings with zero bytes. BINARY without the length L means a single byte.- Specified by:
hasSize
in interfacePlatform
- Overrides:
hasSize
in classPlatformDefaultImpl
- Parameters:
sqlType
- the SQL type- Returns:
- true if the type has a size attribute
- See Also:
TODO collect info for all platforms
-
hasScale
public boolean hasScale(String sqlType)
Description copied from interface:Platform
Returns if the RDBMS-specific SQL type has a scale attribute.- Specified by:
hasScale
in interfacePlatform
- Overrides:
hasScale
in classPlatformDefaultImpl
- Parameters:
sqlType
- the SQL type- Returns:
- true if the type has a scale attribute
- See Also:
TODO collect info for all platforms
-
-