Package io.jmix.dynmodel.impl.db
Class MySqlDynamicModelDbSupport
java.lang.Object
io.jmix.dynmodel.impl.db.DynamicModelDbSupport
io.jmix.dynmodel.impl.db.MySqlDynamicModelDbSupport
- Direct Known Subclasses:
MariaDbDynamicModelDbSupport
-
Field Summary
Fields inherited from class io.jmix.dynmodel.impl.db.DynamicModelDbSupport
DEFAULT_BYTES_LENGTH, DEFAULT_STRING_LENGTH, DEFAULT_URI_LENGTH, FALLBACK_IDENTIFIER, IDENTIFIER_HASH_LENGTH, maxIdentifierLength, metadataTools, reservedWords, STANDARD_RESERVED_WORDS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyPaging(String sql, int firstResult, int maxResults) getAlterColumnTypeSql(String tableName, String columnName, String columnType) Returns SQL that changes the type/length of an existing column.protected Stringprotected StringgetDropUniqueConstraintSql(String tableName, String constraintName) Returns SQL that drops a unique constraint for the given table.protected StringReturns theESCAPEclause (including the leading space) appended to a raw-SQLLIKEpredicate that escapes wildcards with a backslash.protected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected ObjecttoDbOffsetDateTime(OffsetDateTime value) protected ObjecttoDbOffsetTime(OffsetTime value) protected Objectprotected OffsetDateTimetoOffsetDateTime(Object dbValue) protected OffsetTimetoOffsetTime(Object dbValue) protected UUIDbooleanuniqueConstraintExists(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String tableName, String constraintName) Checks whether the named unique constraint already exists on the given table.Methods inherited from class io.jmix.dynmodel.impl.db.DynamicModelDbSupport
appendTrailingUnderscore, canonicalizeIdentifier, configureIdentifierRules, extractUniqueConstraintName, getAddColumnSql, getBytesType, getCreateUniqueConstraintSql, getDoubleType, getEnumIdType, getFloatType, getLength, getLocalDateTimeType, getLocalTimeType, getReferenceJavaType, getSqlType, getSqlTypeByJavaType, getStringType, getUniqueDuplicateCheckPredicate, hashIdentifier, isDuplicateConstraintException, isLob, isReservedWord, normalizeGeneratedIdentifier, resolveConstraintName, setMetadataTools, shortenIdentifier, toBoolean, toByteArray, toDbBoolean, toDbLocalTime, toDbValue, toEnumValue, toLocalDate, toLocalDateTime, toLocalTime, toNumber, toPropertyValue, toUnderscoreSeparated
-
Constructor Details
-
MySqlDynamicModelDbSupport
public MySqlDynamicModelDbSupport()
-
-
Method Details
-
getUuidSqlType
- Specified by:
getUuidSqlTypein classDynamicModelDbSupport
-
getStringLobType
- Overrides:
getStringLobTypein classDynamicModelDbSupport
-
getBytesLobType
- Overrides:
getBytesLobTypein classDynamicModelDbSupport
-
getBooleanType
- Overrides:
getBooleanTypein classDynamicModelDbSupport
-
applyPaging
- Overrides:
applyPagingin classDynamicModelDbSupport
-
getLikeEscapeClause
Description copied from class:DynamicModelDbSupportReturns theESCAPEclause (including the leading space) appended to a raw-SQLLIKEpredicate that escapes wildcards with a backslash. The default emits a single backslash; MySQL/MariaDB interpret backslashes inside string literals and override this to emit a doubled backslash.- Overrides:
getLikeEscapeClausein classDynamicModelDbSupport
-
getOffsetTimeType
- Overrides:
getOffsetTimeTypein classDynamicModelDbSupport
-
getOffsetDateTimeType
- Overrides:
getOffsetDateTimeTypein classDynamicModelDbSupport
-
toDbUuid
- Overrides:
toDbUuidin classDynamicModelDbSupport
-
toUuid
- Overrides:
toUuidin classDynamicModelDbSupport
-
toDbOffsetTime
- Overrides:
toDbOffsetTimein classDynamicModelDbSupport
-
toDbOffsetDateTime
- Overrides:
toDbOffsetDateTimein classDynamicModelDbSupport
-
toOffsetTime
- Overrides:
toOffsetTimein classDynamicModelDbSupport
-
toOffsetDateTime
- Overrides:
toOffsetDateTimein classDynamicModelDbSupport
-
getAlterColumnTypeSql
Description copied from class:DynamicModelDbSupportReturns SQL that changes the type/length of an existing column.- Overrides:
getAlterColumnTypeSqlin classDynamicModelDbSupport- Parameters:
tableName- physical table namecolumnName- physical column namecolumnType- new physical column type- Returns:
- DDL statement
-
getDropUniqueConstraintSql
Description copied from class:DynamicModelDbSupportReturns SQL that drops a unique constraint for the given table.- Overrides:
getDropUniqueConstraintSqlin classDynamicModelDbSupport- Parameters:
tableName- physical table nameconstraintName- physical constraint name- Returns:
- DDL statement
-
uniqueConstraintExists
public boolean uniqueConstraintExists(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, String tableName, String constraintName) Description copied from class:DynamicModelDbSupportChecks whether the named unique constraint already exists on the given table.- Overrides:
uniqueConstraintExistsin classDynamicModelDbSupport- Parameters:
jdbcTemplate- JDBC template for the target storetableName- physical table nameconstraintName- physical constraint name- Returns:
trueif the constraint already exists
-
getUniqueConstraintViolationPattern
- Overrides:
getUniqueConstraintViolationPatternin classDynamicModelDbSupport
-
getDuplicateConstraintPattern
- Overrides:
getDuplicateConstraintPatternin classDynamicModelDbSupport
-