Class PlatformMysqlImpl
- java.lang.Object
-
- org.apache.torque.templates.platform.PlatformDefaultImpl
-
- org.apache.torque.templates.platform.PlatformMysqlImpl
-
- All Implemented Interfaces:
Platform
public class PlatformMysqlImpl extends PlatformDefaultImpl
MySql Platform implementation.- Version:
- $Id: PlatformMysqlImpl.java 1896195 2021-12-20 17:41:20Z gk $
- Author:
- Martin Poeschl
-
-
Constructor Summary
Constructors Constructor Description PlatformMysqlImpl()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanescapeBackslashes()Returns whether backslashes must be escaped in string literals.StringgetAutoIncrement()StringgetDateString(Date date)Formats the given date as date string which is parseable by the database.StringgetTimestampString(Date date)Formats the given date as timestamp string which is parseable by the database.booleanhasScale(String sqlType)precison in time formats is more like a scale, which is the number of digits to the right of the decimal point in a number.booleanhasSize(String sqlType)Returns if the RDBMS-specific SQL type has a size attribute.booleanhasUniqueConstraintSize()Returns whether the database has schema support unique constraint for columns with size-
Methods inherited from class org.apache.torque.templates.platform.PlatformDefaultImpl
createNotNullBeforeAutoincrement, formatDateTimeString, getNullString, getSizeSuffix, getSqlTypeForSchemaType, getTimeString, quoteAndEscape, setSchemaTypeToSqlTypeMapping, usesStandaloneSchema
-
-
-
-
Method Detail
-
getAutoIncrement
public String getAutoIncrement()
- Specified by:
getAutoIncrementin interfacePlatform- Overrides:
getAutoIncrementin classPlatformDefaultImpl- Returns:
- The RDBMS-specific SQL fragment for autoincrement.
- See Also:
Platform.getAutoIncrement()
-
hasSize
public boolean hasSize(String sqlType)
Description copied from interface:PlatformReturns if the RDBMS-specific SQL type has a size attribute.- Specified by:
hasSizein interfacePlatform- Overrides:
hasSizein classPlatformDefaultImpl- Parameters:
sqlType- the SQL type- Returns:
- true if the type has a size attribute
- See Also:
Platform.hasSize(String)
-
hasScale
public boolean hasScale(String sqlType)
precison in time formats is more like a scale, which is the number of digits to the right of the decimal point in a number.- Specified by:
hasScalein interfacePlatform- Overrides:
hasScalein classPlatformDefaultImpl- Parameters:
sqlType- the SQL type- Returns:
- true if the type has a scale attribute
- See Also:
Platform.hasScale(String)
-
escapeBackslashes
protected boolean escapeBackslashes()
Description copied from class:PlatformDefaultImplReturns whether backslashes must be escaped in string literals.- Overrides:
escapeBackslashesin 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:
getDateStringin interfacePlatform- Overrides:
getDateStringin classPlatformDefaultImpl- Parameters:
date- the date to format.- Returns:
- the date string, inclusive string escaping.
-
getTimestampString
public String getTimestampString(Date date)
Formats the given date as timestamp string which is parseable by the database.- Specified by:
getTimestampStringin interfacePlatform- Overrides:
getTimestampStringin classPlatformDefaultImpl- Parameters:
date- the date to format.- Returns:
- the timestamp string, inclusive string escaping.
-
hasUniqueConstraintSize
public boolean hasUniqueConstraintSize()
Returns whether the database has schema support unique constraint for columns with size- Specified by:
hasUniqueConstraintSizein interfacePlatform- Overrides:
hasUniqueConstraintSizein classPlatformDefaultImpl- Returns:
- true if unique column constraint has size
-
-