Class MSSQLServerDBDefinition
- java.lang.Object
-
- nz.co.gregs.dbvolution.databases.definitions.DBDefinition
-
- nz.co.gregs.dbvolution.databases.definitions.MSSQLServerDBDefinition
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MSSQLServer2012DBDefinition
public class MSSQLServerDBDefinition extends DBDefinition
Defines the features of the Microsoft SQL Server database that differ from the standard database.This DBDefinition is automatically included in
MSSQLServerDB
instances, and you should not need to use it directly.- Author:
- Gregory Graham
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class nz.co.gregs.dbvolution.databases.definitions.DBDefinition
DBDefinition.GroupByClauseMethod
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
-
Fields inherited from class nz.co.gregs.dbvolution.databases.definitions.DBDefinition
DECIMAL_FORMAT_WITH_NANO_PRECISION, INTERVAL_SINGLEUNIT_UNIT, INTERVAL_SINGLEUNIT_VALUE
-
-
Constructor Summary
Constructors Constructor Description MSSQLServerDBDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
beginStringValue()
Returns the standard beginning of a string value in the database.String
beginWithClause()
The beginning of the WITH variant supported by this database.String
doBooleanToIntegerTransform(String booleanExpression)
Transforms a bit expression into an integer expression.String
doColumnTransformForSelect(QueryableDatatype<?> qdt, String selectableName)
Perform necessary transformations on the stored value to make it readable by Java.String
doConcatTransform(String firstString, String secondString)
Wraps the provided SQL snippets in a statement that joins the two snippets into one SQL snippet.String
doConcatTransform(String firstString, String secondString, String... rest)
Wraps the provided SQL snippets in a statement that joins the two snippets into one SQL snippet.String
doCurrentUTCDateTimeTransform()
String
doDateAddDaysTransform(String dateValue, String numberOfDays)
Does the required transformation to produce an SQL snippet that adds numberOfdays days to the dateValue.String
doDateAddHoursTransform(String dateValue, String numberOfHours)
Does the required transformation to produce an SQL snippet that adds numberOfHours hours to the dateValue.String
doDateAddMinutesTransform(String dateValue, String numberOfMinutes)
Does the required transformation to produce an SQL snippet that adds numberOfMinutes minutes to the dateValue.String
doDateAddMonthsTransform(String dateValue, String numberOfMonths)
Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.String
doDateAddSecondsTransform(String dateValue, String numberOfSeconds)
Does the required transformation to produce an SQL snippet that adds numberOfSeconds seconds to the dateValue.String
doDateAddWeeksTransform(String dateValue, String numberOfWeeks)
Does the required transformation to produce an SQL snippet that adds numberOfWeeks weeks to the dateValue.String
doDateAddYearsTransform(String dateValue, String numberOfYears)
Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.String
doDayDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in days.String
doDayOfWeekTransform(String dateSQL)
Extracts the weekday from the date provided as a number from 1 to 7.String
doDayTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the day part of the date.String
doFindIntegerInStringTransform(String toSQLString)
String
doFindNumberInStringTransform(String toSQLString)
String
doHourDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in hours.String
doHourTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the hour part of the date.String
doInstantAddDaysTransform(String dateValue, String numberOfDays)
Does the required transformation to produce an SQL snippet that adds numberOfdays days to the dateValue.String
doInstantAddHoursTransform(String dateValue, String numberOfHours)
Does the required transformation to produce an SQL snippet that adds numberOfHours hours to the dateValue.String
doInstantAddMinutesTransform(String dateValue, String numberOfMinutes)
Does the required transformation to produce an SQL snippet that adds numberOfMinutes minutes to the dateValue.String
doInstantAddMonthsTransform(String dateValue, String numberOfMonths)
Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.String
doInstantAddSecondsTransform(String dateValue, String numberOfSeconds)
Does the required transformation to produce an SQL snippet that adds numberOfSeconds seconds to the dateValue.String
doInstantAddWeeksTransform(String dateValue, String numberOfWeeks)
Does the required transformation to produce an SQL snippet that adds numberOfWeeks weeks to the dateValue.String
doInstantAddYearsTransform(String dateValue, String numberOfYears)
Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.String
doInstantDayOfWeekTransform(String dateSQL)
Extracts the weekday from the date provided as a number from 1 to 7.String
doInstantDayTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the day part of the date.String
doInstantHourTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the hour part of the date.String
doInstantMinuteTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the minute part of the date.String
doInstantMonthTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the month part of the date.String
doInstantSecondTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.String
doInstantSubsecondTransform(String dateExpression)
Returns the partial second value from the date.String
doInstantYearTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the year part of the date.protected String
doIntegerToStringTransformUnsafe(String numberExpression)
Transforms a SQL snippet of a integer expression into a character expression for this database.String
doLine2DAllIntersectionPointsWithLine2DTransform(String firstGeometry, String secondGeometry)
Generate the SQL required to find the complete set of all points of intersection between the tow 2 lines.String
doLine2DAsTextTransform(String line2DSQL)
Provide the SQL to derive the WKT version of the Line2D.String
doLine2DEqualsTransform(String toSQLString, String toSQLString0)
Transform the 2 Line2D SQL snippets into an EQUALS comparison of the 2String
doLine2DGetBoundingBoxTransform(String toSQLString)
Create the SQL to derive the bounding box of this Line2D SQLString
doLine2DGetMaxXTransform(String toSQLString)
Generate the SQL that will return the largest X value within the Line2D expression.String
doLine2DGetMaxYTransform(String toSQLString)
Generate the SQL that will return the largest Y value within the Line2D expression.String
doLine2DGetMinXTransform(String toSQLString)
Generate the SQL that will return the smallest X value within the Line2D expression.String
doLine2DGetMinYTransform(String toSQLString)
Generate the SQL that will return the smallest Y value within the Line2D expression.String
doLine2DIntersectionPointWithLine2DTransform(String firstLine, String secondLine)
Generate the SQL required to find the intersection point of the 2 line segment SQL expressions.String
doLine2DIntersectsLine2DTransform(String firstLine, String secondLine)
Generates the SQL required to find whether the 2 lines cross at any point.String
doLine2DMeasurableDimensionsTransform(String toSQLString)
Create the SQL required to get the dimension of this Line2D SQL.String
doLineSegment2DAsTextTransform(String toSQLString)
Generate the SQL required to convert the line segment SQL expression into the WKT string format.String
doLineSegment2DDimensionTransform(String toSQLString)
Generate the SQL required to find the dimension of the line segment SQL expression.String
doLineSegment2DEqualsTransform(String toSQLString, String toSQLString0)
Generate the SQL required to find whether the 2 line segment SQL expressions are equal.String
doLineSegment2DGetBoundingBoxTransform(String toSQLString)
Generate the SQL required to the rectangular boundary that fully encloses the line segment SQL expression.String
doLineSegment2DGetMaxXTransform(String toSQLString)
Generate the SQL required to find the largest X value in the line segment SQL expression.String
doLineSegment2DGetMaxYTransform(String toSQLString)
Generate the SQL required to find the largest Y value in the line segment SQL expression.String
doLineSegment2DGetMinXTransform(String toSQLString)
Generate the SQL required to find the smallest X value in the line segment SQL expression.String
doLineSegment2DGetMinYTransform(String toSQLString)
Generate the SQL required to find the smallest Y value in the line segment SQL expression.String
doLineSegment2DIntersectionPointWithLineSegment2DTransform(String firstLineSegment, String secondLineSegment)
Generate the SQL required to find the intersection point of the 2 line segment SQL expressions.String
doLineSegment2DIntersectsLineSegment2DTransform(String toSQLString, String toSQLString0)
Generates the database specific SQL for testing whether the 2 line segment expressions ever cross.String
doLineSegment2DNotEqualsTransform(String toSQLString, String toSQLString0)
Generate the SQL required to find whether the 2 line segment SQL expressions are NOT equal.String
doMinuteDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in minutes.String
doMinuteTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the minute part of the date.String
doMonthDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in months.String
doMonthTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the month part of the date.String
doMultiPoint2DAsTextTransform(String first)
Provides the SQL the transform the MultiPoint2D value into a WKT value.String
doMultiPoint2DEqualsTransform(String first, String second)
Provide the SQL to compare 2 MultiPoint2Ds using the equivalent of EQUALS.String
doMultiPoint2DGetBoundingBoxTransform(String first)
Provides the SQL the derive the bounding box containing all the points in the MultiPoint2D value.String
doMultiPoint2DGetMaxXTransform(String first)
Provides the SQL that will derive the largest X value of all the points in the MultiPoint2D valueString
doMultiPoint2DGetMaxYTransform(String first)
Provides the SQL that will derive the largest Y value of all the points in the MultiPoint2D valueString
doMultiPoint2DGetMinXTransform(String first)
Provides the SQL that will derive the smallest X value of all the points in the MultiPoint2D valueString
doMultiPoint2DGetMinYTransform(String first)
Provides the SQL that will derive the smallest Y value of all the points in the MultiPoint2D valueString
doMultiPoint2DGetNumberOfPointsTransform(String first)
Provides the SQL the derive the number of points in the multipoint2d value.String
doMultiPoint2DGetPointAtIndexTransform(String first, String index)
Provide the SQL to get point at the supplied index within the MultiPoint2DString
doMultiPoint2DMeasurableDimensionsTransform(String first)
Provides the SQL the derive the dimension (2 basically) of the MultiPoint2D value.String
doMultiPoint2DToLine2DTransform(String first)
Provides the SQL the transform the MultiPoint2D value into aLine2DResult
value.protected String
doNumberToStringTransformUnsafe(String numberExpression)
Transforms a SQL snippet of a number expression into a character expression for this database.String
doPoint2DAsTextTransform(String point2DString)
Provide the SQL to derive the WKT version of the Point2D.String
doPoint2DEqualsTransform(String firstPoint, String secondPoint)
Provide the SQL to compare 2 Point2DsString
doPoint2DGetBoundingBoxTransform(String point2D)
Provide the SQL to derive the Polygon2D representing the Bounding Box of the Point2D.String
doPoint2DGetXTransform(String point2D)
Provide the SQL to return the X coordinate of the Point2DString
doPoint2DGetYTransform(String point2D)
Provide the SQL to return the Y coordinate of the Point2DString
doPoint2DMeasurableDimensionsTransform(String point2D)
Provide the SQL to return the dimension of the Point2DString
doPolygon2DAsTextTransform(String polygonSQL)
Generates the SQL to convert the polygon to the standard text version of a polygon.String
doPolygon2DContainsPoint2DTransform(String polygon2DSQL, String point2DSQL)
Generates the SQL to determine whether the first (polygon) argument contains the second point argument.String
doPolygon2DContainsPolygon2DTransform(String firstGeometry, String secondGeometry)
Test whether the first polygon completely contains the second polygon.String
doPolygon2DDoesNotIntersectTransform(String firstGeometry, String secondGeometry)
Inverse ofdoPolygon2DIntersectsTransform(java.lang.String, java.lang.String)
, tests whether the 2 polygons are non-coincident.String
doPolygon2DEqualsTransform(String firstGeometry, String secondGeometry)
Compare 2 polygons with EQUALS.String
doPolygon2DGetAreaTransform(String toSQLString)
Retrieve the area of the polygon.String
doPolygon2DGetBoundingBoxTransform(String toSQLString)
Create a simple four sided bounding for the polygon.String
doPolygon2DGetExteriorRingTransform(String polygon2DSQL)
Defines the transformation require to transform an SQL Polygon2D into a linestring representing the exterior ring of the polygon.String
doPolygon2DGetMaxXTransform(String polygon2DSQL)
Generate the SQL that will return the largest X value within the Polygon2D expression.String
doPolygon2DGetMaxYTransform(String polygon2DSQL)
Generate the SQL that will return the largest X value within the Polygon2D expression.String
doPolygon2DGetMinXTransform(String polygon2DSQL)
Generate the SQL that will return the smallest X value within the Polygon2D expression.String
doPolygon2DGetMinYTransform(String polygon2DSQL)
Generate the SQL that will return the smallest Y value within the Polygon2D expression.String
doPolygon2DIntersectionTransform(String firstGeometry, String secondGeometry)
Creates a Polygon2D representing the intersection of the Polygon2Ds.String
doPolygon2DIntersectsTransform(String firstGeometry, String secondGeometry)
Test whether the 2 polygons intersect.String
doPolygon2DMeasurableDimensionsTransform(String polygon2DSQL)
Returns the dimension of the polygon.String
doPolygon2DOverlapsTransform(String firstGeometry, String secondGeometry)
Test whether the 2 polygons intersect but not contained or within.String
doPolygon2DTouchesTransform(String firstGeometry, String secondGeometry)
Tests whether the polygons touch.String
doPolygon2DWithinTransform(String firstGeometry, String secondGeometry)
Test whether the first polygon is completely within the second polygon.String
doPositionInStringTransform(String originalString, String stringToFind)
Transforms an SQL snippet into an SQL snippet that provides the index of the string to find.String
doRandomNumberTransform()
Returns the required code to generate a random number.String
doRoundTransform(String toSQLString)
Generate the SQL to apply rounding to the Number expressionsString
doRoundWithDecimalPlacesTransform(String number, String decimalPlaces)
Generate the SQL to apply rounding to the Number expressions with the specified number of decimal places.String
doSecondAndSubsecondTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.String
doSecondDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in whole seconds.String
doSecondTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.String
doStringAccumulateTransform(String accumulateColumn, String separator, String referencedTable)
String
doStringAccumulateTransform(String accumulateColumn, String separator, String orderByColumnName, String referencedTable)
String
doStringEqualsTransform(String firstSQLExpression, String secondSQLExpression)
SQLServer follows the standard, unlike anyone else, and pads the short string with spaces before comparing.String
doStringLengthTransform(String enclosedValue)
Wraps the provided SQL snippet in a statement that the length of the value of the snippet.String
doStringToNumberTransform(String stringResultContainingANumber)
Provide SQL to interpret the String value as a number.String
doSubsecondTransform(String dateExpression)
Returns the partial second value from the date.String
doSubstringTransform(String originalString, String start, String length)
Transforms the arguments into a SQL snippet that produces a substring of the originalString from the start for length characters.String
doTrimFunction(String enclosedValue)
Wraps the provided SQL snippet in a statement that performs trims all spaces from the left and right of the value of the snippet.String
doTruncTransform(String realNumberExpression, String numberOfDecimalPlacesExpression)
Transforms 2 SQL snippets that represent a real number and a integer into a real number with the decimal places reduced to the integer.String
doWeekDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in days.String
doYearDifferenceTransform(String dateValue, String otherDateValue)
Convert the 2 SQL date values into a difference in years.String
doYearTransform(String dateExpression)
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the year part of the date.String
endSQLStatement()
Returns the default ending of an SQL statement for this database.protected String
formatNameForDatabase(String sqlObjectName)
Apply standard object name transformations required by the database.String
formatTableName(DBRow table)
Formats the table name correctly for this database.String
getAlterTableAddColumnSQL(DBRow existingTable, PropertyWrapper<?,?,?> columnPropertyWrapper)
String
getArctan2FunctionName()
Provides the ARCTAN2 function name for this database.String
getColumnAutoIncrementSuffix()
Returns the suffix added to a column definition to support auto-incrementing a column.protected String
getCurrentDateOnlyFunctionName()
Defines the function used to get the current date (excluding time) from the database.protected String
getCurrentDateTimeFunction()
Defines the function used to get the current timestamp from the database.protected String
getCurrentZonedDateTimeFunction()
Defines the function used to get the current timestamp from the database.protected String
getDatabaseDataTypeOfQueryableDatatype(QueryableDatatype<?> qdt)
Supplied to allow the DBDefintion to override the standard QDT datatype.String
getDateFormattedForQuery(Date date)
Transforms the Date instance into a SQL snippet that can be used as a date in a query.String
getDatePartsFormattedForQuery(String years, String months, String days, String hours, String minutes, String seconds, String subsecond, String timeZoneSign, String timeZoneHourOffset, String timeZoneMinuteOffSet)
Transforms the specific parts of a date from their SQL snippets into a SQL snippet that can be used as a date in a query.String
getDefaultOrderingClause()
String
getFalseValue()
The value used for FALSE boolean values.String
getIfNullFunctionName()
Provides the function name of the COALESCE, IFNULL, or NVL function.Collection<? extends String>
getInsertCleanUp(DBRow table)
Collection<? extends String>
getInsertPreparation(DBRow table)
String
getLimitRowsSubClauseAfterWhereClause(QueryState state, QueryOptions options)
Provides an opportunity for the definition to insert a row limiting statement after the query for example MySQL/MariaDB use SELECT ...String
getLogBase10FunctionName()
Return the function name for the Logarithm Base10 function.String
getNaturalLogFunctionName()
Return the function name for the Natural Logarithm function.String
getRoundUpFunctionName()
Return the function name for the RoundUp function.String
getStandardDeviationFunctionName()
Provides the function of the function that provides the standard deviation of a selection.String
getStringLengthFunctionName()
Returns the function name of the function used to determine the number of characters in the value.String
getTrueValue()
The value used for TRUE boolean values.boolean
isDuplicateColumnException(Exception exc)
LargeObjectHandlerType
preferredLargeObjectReader(DBLargeObject<?> lob)
LargeObjectHandlerType
preferredLargeObjectWriter(DBLargeObject<?> lob)
boolean
prefersDatesReadAsStrings()
Indicates whether the database prefers date values to be read as Strings.boolean
prefersLargeObjectsReadAsBase64CharacterStream(DBLargeObject<?> lob)
Indicates whether the database requires LargeObjects to be encoded as Base64 CLOBS using the CharacterStream method to read the value.boolean
prefersLargeObjectsSetAsBase64String(DBLargeObject<?> lob)
Indicates that the database prefers Large Object values to be set using the setCharacterStream method.boolean
requiresClosedPolygons()
boolean
requiresOnClauseForAllJoins()
boolean
requiresReversingLineStringsFromDatabase()
boolean
supportsArraysNatively()
Indicates if the database supports ARRAYs natively and the functionality has been implemented.boolean
supportsComparingBooleanResults()
Indicates whether the database supports statements that compares to boolean values using EQUALS, NOT EQUALS, etc.boolean
supportsDateRepeatDatatypeFunctions()
boolean
supportsDegreesFunction()
MSSQLserver only supports integer degrees, and that's not good enough.boolean
supportsDurationNatively()
protected boolean
supportsGreatestOfNatively()
MS SQLServer does not support the GREATESTOF operation natively.boolean
supportsHyperbolicFunctionsNatively()
Indicates that this database supports hyperbolic functions natively.protected boolean
supportsLeastOfNatively()
MS SQLServer does not support the LEASTOF operation natively.boolean
supportsNullsOrderingStandard()
boolean
supportsPurelyFunctionalGroupByColumns()
MS SQLServer does not support the grouping by columns that do not access table data.String
transformCoordinateArrayToDatabasePolygon2DFormat(List<String> coordinateSQL)
Override this method to provide the SQL that will create a database Polygon2D value from the list of presumed coordinates.String
transformCoordinatesIntoDatabasePoint2DFormat(String xValue, String yValue)
Provide the SQL that correctly represents these coordinates in this database.com.vividsolutions.jts.geom.LineString
transformDatabaseLine2DValueToJTSLineString(String lineStringAsSQL)
From the database's representation of a Lin2D create a JTS LineString.com.vividsolutions.jts.geom.LineSegment
transformDatabaseLineSegment2DValueToJTSLineSegment(String lineSegmentAsSQL)
Convert the String object returned by the database into a JTS LineSegment object.com.vividsolutions.jts.geom.MultiPoint
transformDatabaseMultiPoint2DValueToJTSMultiPoint(String pointsAsString)
Convert the database's string representation of a MultiPoint2D value into a MultiPoint..com.vividsolutions.jts.geom.Point
transformDatabasePoint2DValueToJTSPoint(String pointsAsString)
From the database's representation of a Point2D create a JTS Point.String
transformLineSegmentIntoDatabaseLineSegment2DFormat(com.vividsolutions.jts.geom.LineSegment lineSegment)
Convert the JTS LineSegment object into a SQL expression that the database will accept as a line segment.String
transformLineStringIntoDatabaseLine2DFormat(com.vividsolutions.jts.geom.LineString line)
Provide the SQL that correctly represents this LineString in this database.String
transformMultiPoint2DToDatabaseMultiPoint2DValue(com.vividsolutions.jts.geom.MultiPoint points)
Provide the SQL that correctly represents this MultiPoint2D value in this database.String
transformPoint2DArrayToDatabasePolygon2DFormat(List<String> pointSQL)
Create the SQL to transform a Point2DArray SQL into a Polygon2DString
transformPoint2DIntoDatabaseFormat(com.vividsolutions.jts.geom.Point point)
Provide the SQL that correctly represents this Point2D in this database.String
transformPolygonIntoDatabasePolygon2DFormat(com.vividsolutions.jts.geom.Polygon polygon2DInWKTFormat)
Generate the SQL that will transform a WKT version of a Polygon2D into the database's version of a Polygon2D.DBExpression
transformToGroupableType(DBExpression expression)
DBExpression
transformToSelectableType(DBExpression columnExpression)
DBExpression
transformToSortableType(DBExpression columnExpression)
Transform a datatype not supported by the database into a type that the database does support.DBExpression
transformToStorableType(DBExpression columnExpression)
Transform a datatype not supported by the database into a type that the database does support.DBExpression
transformToWhenableType(BooleanExpression test)
-
Methods inherited from class nz.co.gregs.dbvolution.databases.definitions.DBDefinition
beginAndLine, beginConditionClauseLine, beginDeleteLine, beginFromClause, beginFullOuterJoin, beginGroupByClause, beginInnerJoin, beginInsertColumnList, beginInsertLine, beginJoinClauseLine, beginLeftOuterJoin, beginNumberValue, beginOnClause, beginOrderByClause, beginOrLine, beginRightOuterJoin, beginSelectStatement, beginSetClause, beginTableAlias, beginUpdateLine, beginValueClause, beginValueSeparatorClause, beginWhereClause, beginWhereClauseLine, beginWithClausePrimingQuery, beginWithClauseRecursiveQuery, canProduceNullStrings, convertNullToEmptyString, countStarClause, doBitsValueTransform, doBooleanArrayElementTransform, doBooleanArrayResultInterpretation, doBooleanArrayTransform, doBooleanStatementToBooleanComparisonValueTransform, doBooleanValueToBooleanComparisonValueTransform, doBooleanValueTransform, doChooseTransformation, doComparableInstantTransform, doCurrentDateOnlyTransform, doCurrentDateTimeTransform, doCurrentTimeTransform, doCurrentUTCTimeTransform, doDateAtTimeZoneTransform, doDateIfNullTransform, doDateMinusDateRepeatTransform, doDateMinusDurationTransform, doDateMinusToDateRepeatTransformation, doDatePlusDateRepeatTransform, doDatePlusDurationTransform, doDateRepeatEqualsTransform, doDateRepeatGetDaysTransform, doDateRepeatGetHoursTransform, doDateRepeatGetMinutesTransform, doDateRepeatGetMonthsTransform, doDateRepeatGetSecondsTransform, doDateRepeatGetYearsTransform, doDateRepeatGreaterThanEqualsTransform, doDateRepeatGreaterThanTransform, doDateRepeatLessThanEqualsTransform, doDateRepeatLessThanTransform, doDateRepeatNotEqualsTransform, doDateRepeatToStringTransform, doDegreesTransform, doDurationEqualsTransform, doDurationGreaterThanEqualsTransform, doDurationGreaterThanTransform, doDurationLessThanEqualsTransform, doDurationLessThanTransform, doEndOfMonthTransform, doFormatAsDateRepeatSeconds, doGreatestOfTransformation, doIfEmptyStringThenElse, doIfNullThenElse, doIfThenElseTransform, doInstantEndOfMonthTransform, doIntegerEqualsTransform, doIntegerIfNullTransform, doIntegerToBitTransform, doIntegerToNumberTransform, doIntegerToStringTransform, doInTransform, doIsEmptyStringTransform, doIsNullOrIsEmptyStringTransform, doIsNullTransform, doLeastOfTransformation, doLeftPadTransform, doLeftTrimTransform, doLine2DGetMagnitudeTransform, doLine2DHasMagnitudeTransform, doLine2DNotEqualsTransform, doLine2DSpatialDimensionsTransform, doLineSegment2DEndPointTransform, doLineSegment2DGetMagnitudeTransform, doLineSegment2DHasMagnitudeTransform, doLineSegment2DSpatialDimensionsTransform, doLineSegment2DStartPointTransform, doLogBase10IntegerTransform, doLogBase10NumberTransform, doLowercaseTransform, doModulusTransform, doMultiPoint2DGetMagnitudeTransform, doMultiPoint2DHasMagnitudeTransform, doMultiPoint2DNotEqualsTransform, doMultiPoint2DSpatialDimensionsTransform, doNewLocalDateFromYearMonthDayTransform, doNotInTransform, doNumberEqualsTransform, doNumberIfNullTransform, doNumberToIntegerTransform, doNumberToStringTransform, doPoint2DDistanceBetweenTransform, doPoint2DGetMagnitudeTransform, doPoint2DHasMagnitudeTransform, doPoint2DSpatialDimensionsTransform, doPolygon2DGetMagnitudeTransform, doPolygon2DHasMagnitudeTransform, doPolygon2DSpatialDimensionsTransform, doPolygon2DUnionTransform, doRadiansTransform, doRandomIntegerTransform, doReplaceTransform, doRightPadTransform, doRightTrimTransform, doSelectFromRecursiveTable, doStringAccumulateTransform, doStringIfNullTransform, doStringIfNullUseEmptyStringTransform, doStringLiteralWrapping, doSubstringAfterTransform, doSubstringBeforeTransform, doUppercaseTransform, doWrapQueryForPaging, dropTriggerBasedIdentitySQL, endDeleteLine, endInsertColumnList, endInsertLine, endMultilineComment, endNumberValue, endOnClause, endOrderByClause, endStringValue, endTableAlias, endValueClause, endWithClausePrimingQuery, endWithClauseRecursiveQuery, exceptionIsTableFound, exceptionIsTableNotFound, formatColumnName, formatColumnNameForDBQueryResultSet, formatExpressionAlias, formatForColumnAlias, formatPrimaryKeyForRetrievingGeneratedKeys, formatTableAlias, formatTableAliasAndColumnName, formatTableAliasAndColumnNameForSelectClause, formatTableAndColumnName, formatWithClauseTableDefinition, getAddColumnColumnSQL, getAlterTableAddForeignKeyStatement, getAlterTableDropForeignKeyStatement, getAverageFunctionName, getCheezBurger, getChooseFunctionName, getCountFunctionName, getCreateDatabase, getCreateTableColumnsEnd, getCreateTableColumnsNameAndTypeSeparator, getCreateTableColumnsSeparator, getCreateTableColumnsStart, getCreateTablePrimaryKeyClauseEnd, getCreateTablePrimaryKeyClauseMiddle, getCreateTablePrimaryKeyClauseStart, getCreateTableStart, getCurrentTimeFunction, getCurrentUserFunctionName, getDenseRankFunctionName, getDropDatabase, getDropTableIfExistsClause, getDropTableStart, getEmptyString, getEqualsComparator, getExpFunctionName, getFalseOperation, getFirstValueFunctionName, getForeignKeyClauseForCreateTable, getFromClause, getFromDualEquivalent, getGreatestOfFunctionName, getHavingClauseStart, getIndexClauseForCreateTable, getInstantFormattedForQuery, getInstantPartsFormattedForQuery, getLagFunctionName, getLastValueFunctionName, getLeadFunctionName, getLeastOfFunctionName, getLimitRowsSubClauseDuringSelectClause, getLocalDateFormattedForQuery, getLocalDatePartsFormattedForQuery, getLocalDateTimeFormattedForQuery, getLocalDateTimeOffsetHours, getLocalDateTimeOffsetMinutes, getLowercaseFunctionName, getMaxFunctionName, getMinFunctionName, getNegationFunctionName, getNextSequenceValueFunctionName, getNotEqualsComparator, getNthValueFunctionName, getNTilesFunctionName, getNull, getNullsAnyOrder, getNullsFirst, getNullsLast, getNumericPrecision, getNumericScale, getOracleCompatibleVersion, getOrderByAscending, getOrderByDescending, getOrderByDirectionClause, getOrderByDirectionClause, getParseDurationPartOffset, getPercentRankFunctionName, getPreparedVariableSymbol, getPrimaryKeySequenceName, getPrimaryKeyTriggerName, getQueryableDatatypeClassForSQLDatatype, getRankFunctionName, getRecursiveQueryDepthColumnName, getRetrieveLastInsertedRowSQL, getRightTrimFunctionName, getRowNumberFunctionName, getSchemaAndTableSeparator, getSequenceUpdateSQL, getSpatial2DIndexSQL, getSpecialAutoIncrementType, getSpecialPrimaryKeyTypeOfDBDatatype, getSQLToCheckTableExists, getSQLToDropAnyAssociatedDatabaseObjects, getSQLTypeAndModifiersOfDBDatatype, getStartingOrderByClauseSeparator, getStartingSelectSubClauseSeparator, getStartingSetSubClauseSeparator, getSubsequentGroupBySubClauseSeparator, getSubsequentOrderByClauseSeparator, getSubsequentSelectSubClauseSeparator, getSubsequentSetSubClauseSeparator, getSumFunctionName, getSystemTableExclusionPattern, getTableAlias, getTableAliasForObject, getTableExistsSQL, getTableStructureQuery, getTriggerBasedIdentitySQL, getTrueOperation, getTruncFunctionName, getUnionDistinctOperator, getUnionOperator, getUppercaseFunctionName, getUTCDateFormattedForQuery, getValuesClauseColumnSeparator, getValuesClauseValueSeparator, getWhereClauseBeginningCondition, getWhereClauseBeginningCondition, hasLocalDateTimeOffset, hasSpecialAutoIncrementType, hasSpecialPrimaryKeyTypeForDBDatatype, isColumnNamesCaseSensitive, isPrimaryKeyAlreadyExistsException, parseDateFromGetString, parseDateRepeatFromGetString, parseDurationFromGetString, parseInstantFromGetString, parseLocalDateFromGetString, parseLocalDateTimeFromGetString, persistentConnectionRequired, preferredGroupByClauseMethod, prefersIndexBasedOrderByClause, prefersInstantsReadAsStrings, prefersLargeObjectsReadAsBLOB, prefersLargeObjectsReadAsBytes, prefersLargeObjectsReadAsCLOB, prefersLargeObjectsSetAsBLOB, prefersLargeObjectsSetAsCharacterStream, prefersTrailingPrimaryKeyDefinition, prefersTriggerBasedIdentities, propertyWrapperConformsToAutoIncrementType, requiredToProduceEmptyStringsForNull, requiresAddingTimeZoneToCurrentLocalDateTime, requiresRecursiveTableAlias, requiresSequenceUpdateAfterManualInsert, requiresSortedSubselectForStringAggregate, requiresSpatial2DIndexes, safeString, sanityCheckDBTableField, setLocalDateTimeOffsetHours, setLocalDateTimeOffsetMinutes, startMultilineComment, supportsAlterTableAddConstraint, supportsArcSineFunction, supportsBulkInserts, supportsChooseNatively, supportsCotangentFunction, supportsDifferenceBetweenNullAndEmptyStringNatively, supportsDropTableIfExists, supportsDurationDatatypeFunctions, supportsExpFunction, supportsFullOuterJoin, supportsFullOuterJoinNatively, supportsGeneratedKeys, supportsLeftPadTransform, supportsModulusFunction, supportsPagingNatively, supportsRadiansFunction, supportsRecursiveQueriesNatively, supportsRetrievingLastInsertedRowViaSQL, supportsRightOuterJoinNatively, supportsRightPadTransform, supportsRowLimitsNatively, supportsStandardDeviationFunction, supportsStatementIsClosed, supportsTableCheckingViaMetaData, supportsTimeZones, supportsUnionDistinct, supportsWindowingFunctionsInTheHavingClause, supportsWindowingFunctionsInTheOrderByClause, supportsXOROperator, toLowerCase, transformDatabasePolygon2DToJTSPolygon, transformJavaDurationIntoDatabaseDuration, transformPeriodIntoDateRepeat, willCloseConnectionOnStatementCancel, wrapNameForDatabase
-
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDateFormattedForQuery
public String getDateFormattedForQuery(Date date)
Description copied from class:DBDefinition
Transforms the Date instance into a SQL snippet that can be used as a date in a query.For instance the date might be transformed into a string like " DATETIME('2013-03-23 00:00:00') "
- Specified by:
getDateFormattedForQuery
in classDBDefinition
- Parameters:
date
- date- Returns:
- the date formatted as a string that the database will correctly interpret as a date.
-
getDatePartsFormattedForQuery
public String getDatePartsFormattedForQuery(String years, String months, String days, String hours, String minutes, String seconds, String subsecond, String timeZoneSign, String timeZoneHourOffset, String timeZoneMinuteOffSet)
Description copied from class:DBDefinition
Transforms the specific parts of a date from their SQL snippets into a SQL snippet that can be used as a date in a query.For instance the date parts might be transformed into a string like " DATETIME('2013-03-23 00:00:00') "
- Specified by:
getDatePartsFormattedForQuery
in classDBDefinition
- Parameters:
years
- the sql representing the years part of the datemonths
- the sql representing the months (1-12) part of the datedays
- the sql representing the days (0-31) part of the datehours
- the sql representing the hours (0-24) part of the dateminutes
- the sql representing the minutes (0-60) part of the dateseconds
- the sql representing the seconds (0-59) part of the datesubsecond
- the sql representing the subsecond (0.0-0.9999) part of the date, precision is based on the database's limitationstimeZoneSign
- + or -timeZoneHourOffset
- the sql representing the minutes (0-59) part of the date's time zonetimeZoneMinuteOffSet
- the sql representing the hours (0-13) part of the date's time zone- Returns:
- the date formatted as a string that the database will be correctly interpret as a date.
-
doConcatTransform
public String doConcatTransform(String firstString, String secondString, String... rest)
Description copied from class:DBDefinition
Wraps the provided SQL snippets in a statement that joins the two snippets into one SQL snippet.- Overrides:
doConcatTransform
in classDBDefinition
- Parameters:
firstString
- firstStringsecondString
- secondStringrest
- the other strings to concatenate- Returns:
- SQL snippet
- See Also:
StringExpression.append(java.lang.String)
,StringExpression.append(java.lang.Number)
,StringExpression.append(nz.co.gregs.dbvolution.results.StringResult)
,StringExpression.append(nz.co.gregs.dbvolution.results.NumberResult)
-
getDatabaseDataTypeOfQueryableDatatype
protected String getDatabaseDataTypeOfQueryableDatatype(QueryableDatatype<?> qdt)
Description copied from class:DBDefinition
Supplied to allow the DBDefintion to override the standard QDT datatype.When the
- Overrides:
getDatabaseDataTypeOfQueryableDatatype
in classDBDefinition
- Parameters:
qdt
- qdt- Returns:
- the databases type for the QDT as a string
-
doColumnTransformForSelect
public String doColumnTransformForSelect(QueryableDatatype<?> qdt, String selectableName)
Description copied from class:DBDefinition
Perform necessary transformations on the stored value to make it readable by Java.Primarily used on Spatial types, this method allows a data type unknown to JDBC to be transformed into the necessary type (usually a String) to be read by Java and DBvolution.
- Overrides:
doColumnTransformForSelect
in classDBDefinition
- Parameters:
qdt
- the DBV value to be storedselectableName
- the selectable value- Returns:
- SQL
-
prefersDatesReadAsStrings
public boolean prefersDatesReadAsStrings()
Description copied from class:DBDefinition
Indicates whether the database prefers date values to be read as Strings.Normally dates are read as dates but this method switches DBvolution to using a text mode.
- Overrides:
prefersDatesReadAsStrings
in classDBDefinition
- Returns:
- the default implementation returns false.
- See Also:
DBDefinition.parseDateFromGetString(java.lang.String)
-
formatTableName
public String formatTableName(DBRow table)
Description copied from class:DBDefinition
Formats the table name correctly for this database.Used wherever a table alias is inappropriate, for instance UPDATE statements.
- Overrides:
formatTableName
in classDBDefinition
- Parameters:
table
- table- Returns:
- a string of the table name formatted for this database definition
-
formatNameForDatabase
protected String formatNameForDatabase(String sqlObjectName)
Description copied from class:DBDefinition
Apply standard object name transformations required by the database.This methods helps support database specific naming rules by allowing post-processing of the object names to conform to the rules.
- Overrides:
formatNameForDatabase
in classDBDefinition
- Parameters:
sqlObjectName
- the Java object name to be transformed into a database object name.- Returns:
- the object name formatted for use with this database
-
endSQLStatement
public String endSQLStatement()
Description copied from class:DBDefinition
Returns the default ending of an SQL statement for this database.- Overrides:
endSQLStatement
in classDBDefinition
- Returns:
- ";" or equivalent.
-
beginStringValue
public String beginStringValue()
Description copied from class:DBDefinition
Returns the standard beginning of a string value in the database.The default method returns "'", that is a single quote.
- Overrides:
beginStringValue
in classDBDefinition
- Returns:
- the formatting required at the beginning of a string value.
-
getLimitRowsSubClauseAfterWhereClause
public String getLimitRowsSubClauseAfterWhereClause(QueryState state, QueryOptions options)
Description copied from class:DBDefinition
Provides an opportunity for the definition to insert a row limiting statement after the query for example MySQL/MariaDB use SELECT ... FROM ... WHERE ... LIMIT 10 ; Based on the example for MySQL/MariaDB this method should return " LIMIT 10 " If the database does not support row limiting this method should throw an exception when rowLimit is not null If the database does not limit rows after the where clause this method should return ""- Overrides:
getLimitRowsSubClauseAfterWhereClause
in classDBDefinition
- Parameters:
state
- the current query stateoptions
- options- Returns:
- the row limiting sub-clause or ""
-
doSubstringTransform
public String doSubstringTransform(String originalString, String start, String length)
Description copied from class:DBDefinition
Transforms the arguments into a SQL snippet that produces a substring of the originalString from the start for length characters.- Overrides:
doSubstringTransform
in classDBDefinition
- Parameters:
originalString
- originalStringstart
- startlength
- length- Returns:
- an expression that will produce an appropriate substring of the originalString.
-
getStringLengthFunctionName
public String getStringLengthFunctionName()
Description copied from class:DBDefinition
Returns the function name of the function used to determine the number of characters in the value.DBvolution tries to ensure that the character length of a value is equal to the character length of an equivalent Java String.
That is to say: DBV.charlength() === java.lang.String.length()
- Overrides:
getStringLengthFunctionName
in classDBDefinition
- Returns:
- "LOWER"
-
doStringEqualsTransform
public String doStringEqualsTransform(String firstSQLExpression, String secondSQLExpression)
SQLServer follows the standard, unlike anyone else, and pads the short string with spaces before comparing.This effectively means strings are trimmed during comparisons whether you like it or not.
While this seems useful, in fact it prevents checking for incorrect strings and breaks the industrial standard.
- Overrides:
doStringEqualsTransform
in classDBDefinition
- Parameters:
firstSQLExpression
- the first string value to comparesecondSQLExpression
- the second string value to compareSupport DBvolution at Patreon
- Returns:
- SQL
-
doTrimFunction
public String doTrimFunction(String enclosedValue)
Description copied from class:DBDefinition
Wraps the provided SQL snippet in a statement that performs trims all spaces from the left and right of the value of the snippet.- Overrides:
doTrimFunction
in classDBDefinition
- Parameters:
enclosedValue
- enclosedValue- Returns:
- SQL snippet
-
doPositionInStringTransform
public String doPositionInStringTransform(String originalString, String stringToFind)
Description copied from class:DBDefinition
Transforms an SQL snippet into an SQL snippet that provides the index of the string to find.- Overrides:
doPositionInStringTransform
in classDBDefinition
- Parameters:
originalString
- originalStringstringToFind
- stringToFind- Returns:
- a SQL snippet that will produce the index of the find string.
-
doConcatTransform
public String doConcatTransform(String firstString, String secondString)
Description copied from class:DBDefinition
Wraps the provided SQL snippets in a statement that joins the two snippets into one SQL snippet.- Overrides:
doConcatTransform
in classDBDefinition
- Parameters:
firstString
- firstStringsecondString
- secondString- Returns:
- SQL snippet
- See Also:
StringExpression.append(java.lang.String)
,StringExpression.append(java.lang.Number)
,StringExpression.append(nz.co.gregs.dbvolution.results.StringResult)
,StringExpression.append(nz.co.gregs.dbvolution.results.NumberResult)
-
getIfNullFunctionName
public String getIfNullFunctionName()
Description copied from class:DBDefinition
Provides the function name of the COALESCE, IFNULL, or NVL function.This provides the function name for this database that transforms a NULL into another value.
- Overrides:
getIfNullFunctionName
in classDBDefinition
- Returns:
- "COALESCE"
-
supportsDegreesFunction
public boolean supportsDegreesFunction()
MSSQLserver only supports integer degrees, and that's not good enough.Support DBvolution at Patreon
- Overrides:
supportsDegreesFunction
in classDBDefinition
- Returns:
- false
-
getStandardDeviationFunctionName
public String getStandardDeviationFunctionName()
Description copied from class:DBDefinition
Provides the function of the function that provides the standard deviation of a selection.- Overrides:
getStandardDeviationFunctionName
in classDBDefinition
- Returns:
- "stddev"
-
doStringLengthTransform
public String doStringLengthTransform(String enclosedValue)
Wraps the provided SQL snippet in a statement that the length of the value of the snippet.- Overrides:
doStringLengthTransform
in classDBDefinition
- Parameters:
enclosedValue
- enclosedValueSupport DBvolution at Patreon
- Returns:
- SQL snippet
-
getColumnAutoIncrementSuffix
public String getColumnAutoIncrementSuffix()
Description copied from class:DBDefinition
Returns the suffix added to a column definition to support auto-incrementing a column.- Overrides:
getColumnAutoIncrementSuffix
in classDBDefinition
- Returns:
- " GENERATED BY DEFAULT AS IDENTITY "
-
prefersLargeObjectsSetAsBase64String
public boolean prefersLargeObjectsSetAsBase64String(DBLargeObject<?> lob)
Description copied from class:DBDefinition
Indicates that the database prefers Large Object values to be set using the setCharacterStream method.If both
DBDefinition.prefersLargeObjectsSetAsCharacterStream(nz.co.gregs.dbvolution.datatypes.DBLargeObject)
andDBDefinition.prefersLargeObjectsSetAsBase64String(nz.co.gregs.dbvolution.datatypes.DBLargeObject)
return FALSE, DBvolution will use the setBinaryStream method to set the value.- Overrides:
prefersLargeObjectsSetAsBase64String
in classDBDefinition
- Parameters:
lob
- the DBLargeObject which we are querying about.- Returns:
- the default implementation returns FALSE.
-
prefersLargeObjectsReadAsBase64CharacterStream
public boolean prefersLargeObjectsReadAsBase64CharacterStream(DBLargeObject<?> lob)
Description copied from class:DBDefinition
Indicates whether the database requires LargeObjects to be encoded as Base64 CLOBS using the CharacterStream method to read the value.- Overrides:
prefersLargeObjectsReadAsBase64CharacterStream
in classDBDefinition
- Parameters:
lob
- the DBLargeObject which we are querying about.- Returns:
- the default implementation returns FALSE.
-
getCurrentDateOnlyFunctionName
protected String getCurrentDateOnlyFunctionName()
Description copied from class:DBDefinition
Defines the function used to get the current date (excluding time) from the database.- Overrides:
getCurrentDateOnlyFunctionName
in classDBDefinition
- Returns:
- the default implementation returns " CURRENT_DATE "
-
doBooleanToIntegerTransform
public String doBooleanToIntegerTransform(String booleanExpression)
Description copied from class:DBDefinition
Transforms a bit expression into an integer expression.Used to allow comparison of bit columns in some databases.
- Overrides:
doBooleanToIntegerTransform
in classDBDefinition
- Parameters:
booleanExpression
- bitExpression- Returns:
- the transformation necessary to transform bitExpression into an integer expression in the SQL.
-
doDateAddSecondsTransform
public String doDateAddSecondsTransform(String dateValue, String numberOfSeconds)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfSeconds seconds to the dateValue.- Overrides:
doDateAddSecondsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfSeconds
- numberOfSeconds- Returns:
- an SQL snippet
-
doDateAddMinutesTransform
public String doDateAddMinutesTransform(String dateValue, String numberOfMinutes)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfMinutes minutes to the dateValue.- Overrides:
doDateAddMinutesTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfMinutes
- numberOfMinutes- Returns:
- an SQL snippet
-
doDateAddDaysTransform
public String doDateAddDaysTransform(String dateValue, String numberOfDays)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfdays days to the dateValue.- Overrides:
doDateAddDaysTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfDays
- numberOfDays- Returns:
- an SQL snippet
-
doDateAddHoursTransform
public String doDateAddHoursTransform(String dateValue, String numberOfHours)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfHours hours to the dateValue.- Overrides:
doDateAddHoursTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfHours
- numberOfHours- Returns:
- an SQL snippet
-
doDateAddWeeksTransform
public String doDateAddWeeksTransform(String dateValue, String numberOfWeeks)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfWeeks weeks to the dateValue.- Overrides:
doDateAddWeeksTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfWeeks
- numberOfWeeks- Returns:
- an SQL snippet
-
doDateAddMonthsTransform
public String doDateAddMonthsTransform(String dateValue, String numberOfMonths)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.- Overrides:
doDateAddMonthsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfMonths
- numberOfMonths- Returns:
- an SQL snippet
-
doDateAddYearsTransform
public String doDateAddYearsTransform(String dateValue, String numberOfYears)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.- Overrides:
doDateAddYearsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfYears
- numberOfYears- Returns:
- an SQL snippet
-
doInstantAddSecondsTransform
public String doInstantAddSecondsTransform(String dateValue, String numberOfSeconds)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfSeconds seconds to the dateValue.- Overrides:
doInstantAddSecondsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfSeconds
- numberOfSeconds- Returns:
- an SQL snippet
-
doInstantAddMinutesTransform
public String doInstantAddMinutesTransform(String dateValue, String numberOfMinutes)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfMinutes minutes to the dateValue.- Overrides:
doInstantAddMinutesTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfMinutes
- numberOfMinutes- Returns:
- an SQL snippet
-
doInstantAddDaysTransform
public String doInstantAddDaysTransform(String dateValue, String numberOfDays)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfdays days to the dateValue.- Overrides:
doInstantAddDaysTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfDays
- numberOfDays- Returns:
- an SQL snippet
-
doInstantAddHoursTransform
public String doInstantAddHoursTransform(String dateValue, String numberOfHours)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfHours hours to the dateValue.- Overrides:
doInstantAddHoursTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfHours
- numberOfHours- Returns:
- an SQL snippet
-
doInstantAddWeeksTransform
public String doInstantAddWeeksTransform(String dateValue, String numberOfWeeks)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfWeeks weeks to the dateValue.- Overrides:
doInstantAddWeeksTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfWeeks
- numberOfWeeks- Returns:
- an SQL snippet
-
doInstantAddMonthsTransform
public String doInstantAddMonthsTransform(String dateValue, String numberOfMonths)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.- Overrides:
doInstantAddMonthsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfMonths
- numberOfMonths- Returns:
- an SQL snippet
-
doInstantAddYearsTransform
public String doInstantAddYearsTransform(String dateValue, String numberOfYears)
Description copied from class:DBDefinition
Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.- Overrides:
doInstantAddYearsTransform
in classDBDefinition
- Parameters:
dateValue
- dateValuenumberOfYears
- numberOfYears- Returns:
- an SQL snippet
-
doDayDifferenceTransform
public String doDayDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in days.- Overrides:
doDayDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doWeekDifferenceTransform
public String doWeekDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in days.- Overrides:
doWeekDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doMonthDifferenceTransform
public String doMonthDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in months.- Overrides:
doMonthDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doYearDifferenceTransform
public String doYearDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in years.- Overrides:
doYearDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doHourDifferenceTransform
public String doHourDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in hours.- Overrides:
doHourDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doMinuteDifferenceTransform
public String doMinuteDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in minutes.- Overrides:
doMinuteDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doSecondDifferenceTransform
public String doSecondDifferenceTransform(String dateValue, String otherDateValue)
Description copied from class:DBDefinition
Convert the 2 SQL date values into a difference in whole seconds.- Overrides:
doSecondDifferenceTransform
in classDBDefinition
- Parameters:
dateValue
- dateValueotherDateValue
- otherDateValue- Returns:
- SQL
-
doTruncTransform
public String doTruncTransform(String realNumberExpression, String numberOfDecimalPlacesExpression)
Description copied from class:DBDefinition
Transforms 2 SQL snippets that represent a real number and a integer into a real number with the decimal places reduced to the integer.0 decimal places transforms the real number into an integer.
- Overrides:
doTruncTransform
in classDBDefinition
- Parameters:
realNumberExpression
- realNumberExpressionnumberOfDecimalPlacesExpression
- numberOfDecimalPlacesExpression- Returns:
- an expression that reduces the realNumberExpression to only the number of decimal places in numberOfDecimalPlacesExpression.
-
doYearTransform
public String doYearTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the year part of the date.- Overrides:
doYearTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the year of the supplied date.
-
doMonthTransform
public String doMonthTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the month part of the date.- Overrides:
doMonthTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the month of the supplied date.
-
doDayTransform
public String doDayTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the day part of the date.Day in this sense is the number of the day within the month: that is the 23 part of Monday 25th of August 2014
- Overrides:
doDayTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the day of the supplied date.
-
doHourTransform
public String doHourTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the hour part of the date.- Overrides:
doHourTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the hour of the supplied date.
-
doMinuteTransform
public String doMinuteTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the minute part of the date.- Overrides:
doMinuteTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the minute of the supplied date.
-
doSecondTransform
public String doSecondTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.Returns only the integer part of the second. Use
DBDefinition.doSecondAndSubsecondTransform(java.lang.String)
orDBDefinition.doSubsecondTransform(java.lang.String)
to get the whole second value or the sub-second part- Overrides:
doSecondTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the second of the supplied date.
-
doSecondAndSubsecondTransform
public String doSecondAndSubsecondTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.- Overrides:
doSecondAndSubsecondTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the second of the supplied date.
-
doSubsecondTransform
public String doSubsecondTransform(String dateExpression)
Description copied from class:DBDefinition
Returns the partial second value from the date.This should return the most detailed possible value less than a second for the date expression provided. It should always return a value less than 1s.
- Overrides:
doSubsecondTransform
in classDBDefinition
- Parameters:
dateExpression
- the date from which to get the subsecond part of.- Returns:
- SQL
-
doInstantYearTransform
public String doInstantYearTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the year part of the date.- Overrides:
doInstantYearTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the year of the supplied date.
-
doInstantMonthTransform
public String doInstantMonthTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the month part of the date.- Overrides:
doInstantMonthTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the month of the supplied date.
-
doInstantDayTransform
public String doInstantDayTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the day part of the date.Day in this sense is the number of the day within the month: that is the 23 part of Monday 25th of August 2014
- Overrides:
doInstantDayTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the day of the supplied date.
-
doInstantHourTransform
public String doInstantHourTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the hour part of the date.- Overrides:
doInstantHourTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the hour of the supplied date.
-
doInstantMinuteTransform
public String doInstantMinuteTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the minute part of the date.- Overrides:
doInstantMinuteTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the minute of the supplied date.
-
doInstantSecondTransform
public String doInstantSecondTransform(String dateExpression)
Description copied from class:DBDefinition
Transforms a SQL snippet that is assumed to be a date into an SQL snippet that provides the second part of the date.- Overrides:
doInstantSecondTransform
in classDBDefinition
- Parameters:
dateExpression
- dateExpression- Returns:
- a SQL snippet that will produce the second of the supplied date.
-
doInstantSubsecondTransform
public String doInstantSubsecondTransform(String dateExpression)
Description copied from class:DBDefinition
Returns the partial second value from the date.This should return the most detailed possible value less than a second for the date expression provided. It should always return a value less than 1s.
- Overrides:
doInstantSubsecondTransform
in classDBDefinition
- Parameters:
dateExpression
- the date from which to get the subsecond part of.- Returns:
- SQL
-
supportsComparingBooleanResults
public boolean supportsComparingBooleanResults()
Description copied from class:DBDefinition
Indicates whether the database supports statements that compares to boolean values using EQUALS, NOT EQUALS, etc.If the database supports statements that resolve to "true = true", this method will return TRUE.
Internally this method is used to allow DBvolution to alter the SQL for MS SQLServer so that DBBoolean columns can be compared like with other databases.
- Overrides:
supportsComparingBooleanResults
in classDBDefinition
- Returns:
- TRUE if this database can compare boolean values, FALSE otherwise.
-
supportsLeastOfNatively
protected boolean supportsLeastOfNatively()
MS SQLServer does not support the LEASTOF operation natively.Support DBvolution at Patreon
- Overrides:
supportsLeastOfNatively
in classDBDefinition
- Returns:
- FALSE
-
supportsGreatestOfNatively
protected boolean supportsGreatestOfNatively()
MS SQLServer does not support the GREATESTOF operation natively.Support DBvolution at Patreon
- Overrides:
supportsGreatestOfNatively
in classDBDefinition
- Returns:
- FALSE
-
supportsPurelyFunctionalGroupByColumns
public boolean supportsPurelyFunctionalGroupByColumns()
MS SQLServer does not support the grouping by columns that do not access table data.Support DBvolution at Patreon
- Overrides:
supportsPurelyFunctionalGroupByColumns
in classDBDefinition
- Returns:
- FALSE
-
doNumberToStringTransformUnsafe
protected String doNumberToStringTransformUnsafe(String numberExpression)
Transforms a SQL snippet of a number expression into a character expression for this database.- Overrides:
doNumberToStringTransformUnsafe
in classDBDefinition
- Parameters:
numberExpression
- numberExpressionSupport DBvolution at Patreon
- Returns:
- a String of the SQL required to transform the number supplied into a character or String type.
-
doIntegerToStringTransformUnsafe
protected String doIntegerToStringTransformUnsafe(String numberExpression)
Transforms a SQL snippet of a integer expression into a character expression for this database.- Overrides:
doIntegerToStringTransformUnsafe
in classDBDefinition
- Parameters:
numberExpression
- numberExpressionSupport DBvolution at Patreon
- Returns:
- a String of the SQL required to transform the number supplied into a character or String type.
-
beginWithClause
public String beginWithClause()
Description copied from class:DBDefinition
The beginning of the WITH variant supported by this database.- Overrides:
beginWithClause
in classDBDefinition
- Returns:
- "WITH RECURSIVE" by default.
-
getCurrentZonedDateTimeFunction
protected String getCurrentZonedDateTimeFunction()
Defines the function used to get the current timestamp from the database.- Overrides:
getCurrentZonedDateTimeFunction
in classDBDefinition
- Returns:
- the default implementation returns " CURRENT_TIMESTAMP "
-
getCurrentDateTimeFunction
protected String getCurrentDateTimeFunction()
Description copied from class:DBDefinition
Defines the function used to get the current timestamp from the database.- Overrides:
getCurrentDateTimeFunction
in classDBDefinition
- Returns:
- the default implementation returns " CURRENT_TIMESTAMP "
-
doCurrentUTCDateTimeTransform
public String doCurrentUTCDateTimeTransform()
- Overrides:
doCurrentUTCDateTimeTransform
in classDBDefinition
-
doDayOfWeekTransform
public String doDayOfWeekTransform(String dateSQL)
Description copied from class:DBDefinition
Extracts the weekday from the date provided as a number from 1 to 7.Provides access to the day of the week as a number from 1 for Sunday to 7 for Saturday.
- Specified by:
doDayOfWeekTransform
in classDBDefinition
- Parameters:
dateSQL
- the date to get the day of the week for.- Returns:
- a number between 1 and 7 for the weekday.
-
doInstantDayOfWeekTransform
public String doInstantDayOfWeekTransform(String dateSQL)
Description copied from class:DBDefinition
Extracts the weekday from the date provided as a number from 1 to 7.Provides access to the day of the week as a number from 1 for Sunday to 7 for Saturday.
- Specified by:
doInstantDayOfWeekTransform
in classDBDefinition
- Parameters:
dateSQL
- the date to get the day of the week for.- Returns:
- a number between 1 and 7 for the weekday.
-
doRoundTransform
public String doRoundTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL to apply rounding to the Number expressions- Overrides:
doRoundTransform
in classDBDefinition
- Parameters:
toSQLString
- the number value- Returns:
- SQL
-
doRoundWithDecimalPlacesTransform
public String doRoundWithDecimalPlacesTransform(String number, String decimalPlaces)
Description copied from class:DBDefinition
Generate the SQL to apply rounding to the Number expressions with the specified number of decimal places.- Overrides:
doRoundWithDecimalPlacesTransform
in classDBDefinition
- Parameters:
number
- the number valuedecimalPlaces
- the number value of the decimal places required.- Returns:
- SQL
-
supportsArraysNatively
public boolean supportsArraysNatively()
Description copied from class:DBDefinition
Indicates if the database supports ARRAYs natively and the functionality has been implemented.- Overrides:
supportsArraysNatively
in classDBDefinition
- Returns:
- TRUE by default.
-
getArctan2FunctionName
public String getArctan2FunctionName()
Description copied from class:DBDefinition
Provides the ARCTAN2 function name for this database.- Overrides:
getArctan2FunctionName
in classDBDefinition
- Returns:
- "atan2" by default.
-
supportsHyperbolicFunctionsNatively
public boolean supportsHyperbolicFunctionsNatively()
Description copied from class:DBDefinition
Indicates that this database supports hyperbolic functions natively.- Overrides:
supportsHyperbolicFunctionsNatively
in classDBDefinition
- Returns:
- TRUE by default.
-
doStringToNumberTransform
public String doStringToNumberTransform(String stringResultContainingANumber)
Description copied from class:DBDefinition
Provide SQL to interpret the String value as a number.Full of ways to fail this is.
- Overrides:
doStringToNumberTransform
in classDBDefinition
- Parameters:
stringResultContainingANumber
- a number value to be coerced to string- Returns:
- SQL that converts the string value into number.
-
transformToStorableType
public DBExpression transformToStorableType(DBExpression columnExpression)
Description copied from class:DBDefinition
Transform a datatype not supported by the database into a type that the database does support.Used mostly to turn Booleans into numbers.
By default this method just returns the input DBExpression.
- Overrides:
transformToStorableType
in classDBDefinition
- Parameters:
columnExpression
- a column expression that might need to change type for this database- Returns:
- The DBExpression as a DBExpression supported by the database.
-
transformToSelectableType
public DBExpression transformToSelectableType(DBExpression columnExpression)
- Overrides:
transformToSelectableType
in classDBDefinition
-
transformToGroupableType
public DBExpression transformToGroupableType(DBExpression expression)
- Overrides:
transformToGroupableType
in classDBDefinition
-
transformToWhenableType
public DBExpression transformToWhenableType(BooleanExpression test)
- Overrides:
transformToWhenableType
in classDBDefinition
-
transformToSortableType
public DBExpression transformToSortableType(DBExpression columnExpression)
Description copied from class:DBDefinition
Transform a datatype not supported by the database into a type that the database does support.Used mostly to turn Booleans into numbers.
By default this method just returns the input DBExpression.
- Overrides:
transformToSortableType
in classDBDefinition
- Parameters:
columnExpression
- a column expression that might need to change type for this database- Returns:
- The DBExpression as a DBExpression supported by the database.
-
doPoint2DEqualsTransform
public String doPoint2DEqualsTransform(String firstPoint, String secondPoint)
Description copied from class:DBDefinition
Provide the SQL to compare 2 Point2Ds- Overrides:
doPoint2DEqualsTransform
in classDBDefinition
- Parameters:
firstPoint
- a point2d value to comparesecondPoint
- a point2d value to compare- Returns:
- SQL
-
doPoint2DGetXTransform
public String doPoint2DGetXTransform(String point2D)
Description copied from class:DBDefinition
Provide the SQL to return the X coordinate of the Point2D- Overrides:
doPoint2DGetXTransform
in classDBDefinition
- Parameters:
point2D
- a point2d value- Returns:
- SQL
-
doPoint2DGetYTransform
public String doPoint2DGetYTransform(String point2D)
Description copied from class:DBDefinition
Provide the SQL to return the Y coordinate of the Point2D- Overrides:
doPoint2DGetYTransform
in classDBDefinition
- Parameters:
point2D
- a point2d value- Returns:
- SQL
-
doPoint2DMeasurableDimensionsTransform
public String doPoint2DMeasurableDimensionsTransform(String point2D)
Description copied from class:DBDefinition
Provide the SQL to return the dimension of the Point2DPoint is a 0-dimensional objects for this purpose.
- Overrides:
doPoint2DMeasurableDimensionsTransform
in classDBDefinition
- Parameters:
point2D
- a point2d value- Returns:
- SQL
-
doPoint2DGetBoundingBoxTransform
public String doPoint2DGetBoundingBoxTransform(String point2D)
Description copied from class:DBDefinition
Provide the SQL to derive the Polygon2D representing the Bounding Box of the Point2D.- Overrides:
doPoint2DGetBoundingBoxTransform
in classDBDefinition
- Parameters:
point2D
- a point2d value- Returns:
- SQL
-
doPoint2DAsTextTransform
public String doPoint2DAsTextTransform(String point2DString)
Description copied from class:DBDefinition
Provide the SQL to derive the WKT version of the Point2D.- Overrides:
doPoint2DAsTextTransform
in classDBDefinition
- Parameters:
point2DString
- a point2d value- Returns:
- SQL
-
doLine2DAsTextTransform
public String doLine2DAsTextTransform(String line2DSQL)
Description copied from class:DBDefinition
Provide the SQL to derive the WKT version of the Line2D.- Overrides:
doLine2DAsTextTransform
in classDBDefinition
- Parameters:
line2DSQL
- a line2d value- Returns:
- SQL
-
doLine2DGetMinYTransform
public String doLine2DGetMinYTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL that will return the smallest Y value within the Line2D expression.- Overrides:
doLine2DGetMinYTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2d value- Returns:
- SQL
-
doLine2DGetMaxYTransform
public String doLine2DGetMaxYTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL that will return the largest Y value within the Line2D expression.- Overrides:
doLine2DGetMaxYTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2 value- Returns:
- SQL
-
doLine2DGetMinXTransform
public String doLine2DGetMinXTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL that will return the smallest X value within the Line2D expression.- Overrides:
doLine2DGetMinXTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2d value- Returns:
- SQL
-
doLine2DGetMaxXTransform
public String doLine2DGetMaxXTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL that will return the largest X value within the Line2D expression.- Overrides:
doLine2DGetMaxXTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2d value- Returns:
- SQL
-
doLine2DGetBoundingBoxTransform
public String doLine2DGetBoundingBoxTransform(String toSQLString)
Description copied from class:DBDefinition
Create the SQL to derive the bounding box of this Line2D SQL- Overrides:
doLine2DGetBoundingBoxTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2d value- Returns:
- SQL
-
doLine2DMeasurableDimensionsTransform
public String doLine2DMeasurableDimensionsTransform(String toSQLString)
Description copied from class:DBDefinition
Create the SQL required to get the dimension of this Line2D SQL.- Overrides:
doLine2DMeasurableDimensionsTransform
in classDBDefinition
- Parameters:
toSQLString
- the line2d value- Returns:
- the dimension (probably 1)
-
doLine2DEqualsTransform
public String doLine2DEqualsTransform(String toSQLString, String toSQLString0)
Description copied from class:DBDefinition
Transform the 2 Line2D SQL snippets into an EQUALS comparison of the 2- Overrides:
doLine2DEqualsTransform
in classDBDefinition
- Parameters:
toSQLString
- the first line2d value to comparetoSQLString0
- the second line2d value to compare- Returns:
- SQL
-
doLine2DIntersectsLine2DTransform
public String doLine2DIntersectsLine2DTransform(String firstLine, String secondLine)
Description copied from class:DBDefinition
Generates the SQL required to find whether the 2 lines cross at any point.- Overrides:
doLine2DIntersectsLine2DTransform
in classDBDefinition
- Parameters:
firstLine
- the first line2d value to comparesecondLine
- the second line2d value to compare- Returns:
- an SQL expression that will evaluate to TRUE FALSE or NULL, depending on whether the lines cross at any point.
-
doLine2DIntersectionPointWithLine2DTransform
public String doLine2DIntersectionPointWithLine2DTransform(String firstLine, String secondLine)
Description copied from class:DBDefinition
Generate the SQL required to find the intersection point of the 2 line segment SQL expressions.- Overrides:
doLine2DIntersectionPointWithLine2DTransform
in classDBDefinition
- Parameters:
firstLine
- the first line2d to comparesecondLine
- the second line2d to compare- Returns:
- an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
-
doLine2DAllIntersectionPointsWithLine2DTransform
public String doLine2DAllIntersectionPointsWithLine2DTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Generate the SQL required to find the complete set of all points of intersection between the tow 2 lines.- Overrides:
doLine2DAllIntersectionPointsWithLine2DTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first line2d to comparesecondGeometry
- the second line2d to compare- Returns:
- an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
-
transformLineStringIntoDatabaseLine2DFormat
public String transformLineStringIntoDatabaseLine2DFormat(com.vividsolutions.jts.geom.LineString line)
Description copied from class:DBDefinition
Provide the SQL that correctly represents this LineString in this database.- Overrides:
transformLineStringIntoDatabaseLine2DFormat
in classDBDefinition
- Parameters:
line
- a linestring to transform in to a Line2D value- Returns:
- SQL
-
transformCoordinatesIntoDatabasePoint2DFormat
public String transformCoordinatesIntoDatabasePoint2DFormat(String xValue, String yValue)
Description copied from class:DBDefinition
Provide the SQL that correctly represents these coordinates in this database.The same as
DBDefinition.transformPoint2DIntoDatabaseFormat(com.vividsolutions.jts.geom.Point)
but for two coordinates as SQL.- Overrides:
transformCoordinatesIntoDatabasePoint2DFormat
in classDBDefinition
- Parameters:
xValue
- a number valueyValue
- a number value- Returns:
- SQL
-
transformPoint2DIntoDatabaseFormat
public String transformPoint2DIntoDatabaseFormat(com.vividsolutions.jts.geom.Point point)
Description copied from class:DBDefinition
Provide the SQL that correctly represents this Point2D in this database.- Overrides:
transformPoint2DIntoDatabaseFormat
in classDBDefinition
- Parameters:
point
- a point to be turned into an SQL point2d value.- Returns:
- SQL
-
transformPolygonIntoDatabasePolygon2DFormat
public String transformPolygonIntoDatabasePolygon2DFormat(com.vividsolutions.jts.geom.Polygon polygon2DInWKTFormat)
Description copied from class:DBDefinition
Generate the SQL that will transform a WKT version of a Polygon2D into the database's version of a Polygon2D.- Overrides:
transformPolygonIntoDatabasePolygon2DFormat
in classDBDefinition
- Parameters:
polygon2DInWKTFormat
- the polygon2d value- Returns:
- SQL
-
transformCoordinateArrayToDatabasePolygon2DFormat
public String transformCoordinateArrayToDatabasePolygon2DFormat(List<String> coordinateSQL)
Description copied from class:DBDefinition
Override this method to provide the SQL that will create a database Polygon2D value from the list of presumed coordinates.Coordinates are a series of number values that are presumed to be pairs of X and Y values. That is to say the list is a list number values with no formatting other than that required to express the values as numbers.
- Overrides:
transformCoordinateArrayToDatabasePolygon2DFormat
in classDBDefinition
- Parameters:
coordinateSQL
- lots of numbers- Returns:
- a polygon2d value
-
transformPoint2DArrayToDatabasePolygon2DFormat
public String transformPoint2DArrayToDatabasePolygon2DFormat(List<String> pointSQL)
Description copied from class:DBDefinition
Create the SQL to transform a Point2DArray SQL into a Polygon2D- Overrides:
transformPoint2DArrayToDatabasePolygon2DFormat
in classDBDefinition
- Parameters:
pointSQL
- the point2d value- Returns:
- SQL
-
doPolygon2DAsTextTransform
public String doPolygon2DAsTextTransform(String polygonSQL)
Description copied from class:DBDefinition
Generates the SQL to convert the polygon to the standard text version of a polygon.- Overrides:
doPolygon2DAsTextTransform
in classDBDefinition
- Parameters:
polygonSQL
- the polygon2d value- Returns:
- SQL
-
doPolygon2DIntersectionTransform
public String doPolygon2DIntersectionTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Creates a Polygon2D representing the intersection of the Polygon2Ds.- Overrides:
doPolygon2DIntersectionTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d valuesecondGeometry
- the second polygon2d value- Returns:
- SQL that represents a polygon of the intersection, null if there is no intersection.
-
doPolygon2DOverlapsTransform
public String doPolygon2DOverlapsTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Test whether the 2 polygons intersect but not contained or within.- Overrides:
doPolygon2DOverlapsTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compare- Returns:
- SQL that is TRUE if the polygons have intersecting and non-intersecting parts.
-
doPolygon2DIntersectsTransform
public String doPolygon2DIntersectsTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Test whether the 2 polygons intersect.- Overrides:
doPolygon2DIntersectsTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compare- Returns:
- SQL that returns TRUE if they intersect.
-
doPolygon2DTouchesTransform
public String doPolygon2DTouchesTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Tests whether the polygons touch.Checks that a) the polygons have at least on point in common and b) that their interiors do not overlap.
- Overrides:
doPolygon2DTouchesTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compare- Returns:
- SQL snippet
-
doPolygon2DGetAreaTransform
public String doPolygon2DGetAreaTransform(String toSQLString)
Description copied from class:DBDefinition
Retrieve the area of the polygon.- Overrides:
doPolygon2DGetAreaTransform
in classDBDefinition
- Parameters:
toSQLString
- a polygon2D value- Returns:
- SQL that will return the area of the Polygon2D
-
doPolygon2DGetBoundingBoxTransform
public String doPolygon2DGetBoundingBoxTransform(String toSQLString)
Description copied from class:DBDefinition
Create a simple four sided bounding for the polygon.- Overrides:
doPolygon2DGetBoundingBoxTransform
in classDBDefinition
- Parameters:
toSQLString
- a polygon2D value- Returns:
- the SQL required to create a bounding box for the polygon.
-
doPolygon2DEqualsTransform
public String doPolygon2DEqualsTransform(String firstGeometry, String secondGeometry)
Description copied from class:DBDefinition
Compare 2 polygons with EQUALS.- Overrides:
doPolygon2DEqualsTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compare- Returns:
- SQL
-
doPolygon2DContainsPolygon2DTransform
public String doPolygon2DContainsPolygon2DTransform(String firstGeometry, String secondGeometry)
Test whether the first polygon completely contains the second polygon.- Overrides:
doPolygon2DContainsPolygon2DTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compareSupport DBvolution at Patreon
- Returns:
- SQL that is TRUE if the first polygon contains the second.
-
doPolygon2DContainsPoint2DTransform
public String doPolygon2DContainsPoint2DTransform(String polygon2DSQL, String point2DSQL)
Description copied from class:DBDefinition
Generates the SQL to determine whether the first (polygon) argument contains the second point argument.- Overrides:
doPolygon2DContainsPoint2DTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- the polygon2d to compare withpoint2DSQL
- the point2d value that might be inside the polygon2d- Returns:
- SQL
-
doPolygon2DDoesNotIntersectTransform
public String doPolygon2DDoesNotIntersectTransform(String firstGeometry, String secondGeometry)
Inverse ofdoPolygon2DIntersectsTransform(java.lang.String, java.lang.String)
, tests whether the 2 polygons are non-coincident.- Overrides:
doPolygon2DDoesNotIntersectTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compareSupport DBvolution at Patreon
- Returns:
- SQL that is FALSE if the polygons intersect.
-
doPolygon2DWithinTransform
public String doPolygon2DWithinTransform(String firstGeometry, String secondGeometry)
Test whether the first polygon is completely within the second polygon.Compare this to
doPolygon2DContainsPolygon2DTransform(java.lang.String, java.lang.String)
- Overrides:
doPolygon2DWithinTransform
in classDBDefinition
- Parameters:
firstGeometry
- the first polygon2d value to comparesecondGeometry
- the second polygon2d value to compareSupport DBvolution at Patreon
- Returns:
- SQL that is TRUE if the first polygon is within the second.
-
doPolygon2DMeasurableDimensionsTransform
public String doPolygon2DMeasurableDimensionsTransform(String polygon2DSQL)
Returns the dimension of the polygon.This will be "2"
- Overrides:
doPolygon2DMeasurableDimensionsTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- a polygon2d valueSupport DBvolution at Patreon
- Returns:
- "2" unless something has gone horribly wrong.
-
doPolygon2DGetExteriorRingTransform
public String doPolygon2DGetExteriorRingTransform(String polygon2DSQL)
Description copied from class:DBDefinition
Defines the transformation require to transform an SQL Polygon2D into a linestring representing the exterior ring of the polygon.- Overrides:
doPolygon2DGetExteriorRingTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- a polygon2D value- Returns:
- SQL
-
doPolygon2DGetMaxXTransform
public String doPolygon2DGetMaxXTransform(String polygon2DSQL)
Description copied from class:DBDefinition
Generate the SQL that will return the largest X value within the Polygon2D expression.- Overrides:
doPolygon2DGetMaxXTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- the polygon2d value- Returns:
- SQL
-
doPolygon2DGetMinXTransform
public String doPolygon2DGetMinXTransform(String polygon2DSQL)
Description copied from class:DBDefinition
Generate the SQL that will return the smallest X value within the Polygon2D expression.- Overrides:
doPolygon2DGetMinXTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- the polygon2d value- Returns:
- SQL
-
doPolygon2DGetMaxYTransform
public String doPolygon2DGetMaxYTransform(String polygon2DSQL)
Description copied from class:DBDefinition
Generate the SQL that will return the largest X value within the Polygon2D expression.- Overrides:
doPolygon2DGetMaxYTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- the polygon2d value- Returns:
- SQL
-
doPolygon2DGetMinYTransform
public String doPolygon2DGetMinYTransform(String polygon2DSQL)
Description copied from class:DBDefinition
Generate the SQL that will return the smallest Y value within the Polygon2D expression.- Overrides:
doPolygon2DGetMinYTransform
in classDBDefinition
- Parameters:
polygon2DSQL
- the polygon2d value- Returns:
- SQL
-
transformDatabaseLineSegment2DValueToJTSLineSegment
public com.vividsolutions.jts.geom.LineSegment transformDatabaseLineSegment2DValueToJTSLineSegment(String lineSegmentAsSQL) throws com.vividsolutions.jts.io.ParseException
Description copied from class:DBDefinition
Convert the String object returned by the database into a JTS LineSegment object.- Overrides:
transformDatabaseLineSegment2DValueToJTSLineSegment
in classDBDefinition
- Parameters:
lineSegmentAsSQL
- the database linesegment2d value to create aJTS LineSegment
with- Returns:
- a JTS LineSegment derived from the database's response, may be null.
- Throws:
com.vividsolutions.jts.io.ParseException
- malformed WKT will throw an exception
-
transformLineSegmentIntoDatabaseLineSegment2DFormat
public String transformLineSegmentIntoDatabaseLineSegment2DFormat(com.vividsolutions.jts.geom.LineSegment lineSegment)
Description copied from class:DBDefinition
Convert the JTS LineSegment object into a SQL expression that the database will accept as a line segment.By default, creates a WKT representation
- Overrides:
transformLineSegmentIntoDatabaseLineSegment2DFormat
in classDBDefinition
- Parameters:
lineSegment
- the LineSegment to convert to database format.- Returns:
- an SQL expression that can be interpreted by the database as a line segment.
-
doLineSegment2DIntersectsLineSegment2DTransform
public String doLineSegment2DIntersectsLineSegment2DTransform(String toSQLString, String toSQLString0)
Description copied from class:DBDefinition
Generates the database specific SQL for testing whether the 2 line segment expressions ever cross.- Overrides:
doLineSegment2DIntersectsLineSegment2DTransform
in classDBDefinition
- Parameters:
toSQLString
- the first Line2D value to comparetoSQLString0
- the second Line2D value to compare- Returns:
- an SQL expression that will report whether the 2 line segments intersect.
- See Also:
DBDefinition.doLineSegment2DIntersectionPointWithLineSegment2DTransform(java.lang.String, java.lang.String)
-
doLineSegment2DGetMaxXTransform
public String doLineSegment2DGetMaxXTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to find the largest X value in the line segment SQL expression.- Overrides:
doLineSegment2DGetMaxXTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DGetMinXTransform
public String doLineSegment2DGetMinXTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to find the smallest X value in the line segment SQL expression.- Overrides:
doLineSegment2DGetMinXTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DGetMaxYTransform
public String doLineSegment2DGetMaxYTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to find the largest Y value in the line segment SQL expression.- Overrides:
doLineSegment2DGetMaxYTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DGetMinYTransform
public String doLineSegment2DGetMinYTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to find the smallest Y value in the line segment SQL expression.- Overrides:
doLineSegment2DGetMinYTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DGetBoundingBoxTransform
public String doLineSegment2DGetBoundingBoxTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to the rectangular boundary that fully encloses the line segment SQL expression.- Overrides:
doLineSegment2DGetBoundingBoxTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DDimensionTransform
public String doLineSegment2DDimensionTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to find the dimension of the line segment SQL expression.- Overrides:
doLineSegment2DDimensionTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DNotEqualsTransform
public String doLineSegment2DNotEqualsTransform(String toSQLString, String toSQLString0)
Description copied from class:DBDefinition
Generate the SQL required to find whether the 2 line segment SQL expressions are NOT equal.- Overrides:
doLineSegment2DNotEqualsTransform
in classDBDefinition
- Parameters:
toSQLString
- the first LineSegment2D valuetoSQLString0
- the second LineSegment2D value- Returns:
- SQL
-
doLineSegment2DEqualsTransform
public String doLineSegment2DEqualsTransform(String toSQLString, String toSQLString0)
Description copied from class:DBDefinition
Generate the SQL required to find whether the 2 line segment SQL expressions are equal.- Overrides:
doLineSegment2DEqualsTransform
in classDBDefinition
- Parameters:
toSQLString
- the first LineSegment2D valuetoSQLString0
- the second LineSegment2D value- Returns:
- SQL
-
doLineSegment2DAsTextTransform
public String doLineSegment2DAsTextTransform(String toSQLString)
Description copied from class:DBDefinition
Generate the SQL required to convert the line segment SQL expression into the WKT string format.- Overrides:
doLineSegment2DAsTextTransform
in classDBDefinition
- Parameters:
toSQLString
- the LineSegment2D value- Returns:
- SQL
-
doLineSegment2DIntersectionPointWithLineSegment2DTransform
public String doLineSegment2DIntersectionPointWithLineSegment2DTransform(String firstLineSegment, String secondLineSegment)
Description copied from class:DBDefinition
Generate the SQL required to find the intersection point of the 2 line segment SQL expressions.- Overrides:
doLineSegment2DIntersectionPointWithLineSegment2DTransform
in classDBDefinition
- Parameters:
firstLineSegment
- the first LineSegment2D valuesecondLineSegment
- the second LineSegment2D value- Returns:
- an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
-
transformMultiPoint2DToDatabaseMultiPoint2DValue
public String transformMultiPoint2DToDatabaseMultiPoint2DValue(com.vividsolutions.jts.geom.MultiPoint points)
Description copied from class:DBDefinition
Provide the SQL that correctly represents this MultiPoint2D value in this database.- Overrides:
transformMultiPoint2DToDatabaseMultiPoint2DValue
in classDBDefinition
- Parameters:
points
- the MultiPoint2D value- Returns:
- SQL
-
transformDatabaseMultiPoint2DValueToJTSMultiPoint
public com.vividsolutions.jts.geom.MultiPoint transformDatabaseMultiPoint2DValueToJTSMultiPoint(String pointsAsString) throws com.vividsolutions.jts.io.ParseException
Description copied from class:DBDefinition
Convert the database's string representation of a MultiPoint2D value into a MultiPoint..- Overrides:
transformDatabaseMultiPoint2DValueToJTSMultiPoint
in classDBDefinition
- Parameters:
pointsAsString
- the MultiPoint2D value to create aJTS MultiPoint
with.- Returns:
- the MultiPoint2D as a
JTS MultiPoint
instance - Throws:
com.vividsolutions.jts.io.ParseException
- malformed WKT values will throw an exception
-
transformDatabasePoint2DValueToJTSPoint
public com.vividsolutions.jts.geom.Point transformDatabasePoint2DValueToJTSPoint(String pointsAsString) throws com.vividsolutions.jts.io.ParseException
Description copied from class:DBDefinition
From the database's representation of a Point2D create a JTS Point.This is the inverse of
DBDefinition.transformPoint2DIntoDatabaseFormat(com.vividsolutions.jts.geom.Point)
.- Overrides:
transformDatabasePoint2DValueToJTSPoint
in classDBDefinition
- Parameters:
pointsAsString
- a point2d value- Returns:
- a point created from the point2d value
- Throws:
com.vividsolutions.jts.io.ParseException
- if the database result is not a valid WKT
-
doMultiPoint2DEqualsTransform
public String doMultiPoint2DEqualsTransform(String first, String second)
Description copied from class:DBDefinition
Provide the SQL to compare 2 MultiPoint2Ds using the equivalent of EQUALS.- Overrides:
doMultiPoint2DEqualsTransform
in classDBDefinition
- Parameters:
first
- the first MultiPoint2D value to comparesecond
- the second MultiPoint2D value to compare- Returns:
- SQL
-
doMultiPoint2DGetPointAtIndexTransform
public String doMultiPoint2DGetPointAtIndexTransform(String first, String index)
Description copied from class:DBDefinition
Provide the SQL to get point at the supplied index within the MultiPoint2D- Overrides:
doMultiPoint2DGetPointAtIndexTransform
in classDBDefinition
- Parameters:
first
- the first MultiPoint2D value to retrieve a point from.index
- the index at which the required point is at.- Returns:
- SQL
-
doMultiPoint2DGetNumberOfPointsTransform
public String doMultiPoint2DGetNumberOfPointsTransform(String first)
Description copied from class:DBDefinition
Provides the SQL the derive the number of points in the multipoint2d value.- Overrides:
doMultiPoint2DGetNumberOfPointsTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DMeasurableDimensionsTransform
public String doMultiPoint2DMeasurableDimensionsTransform(String first)
Description copied from class:DBDefinition
Provides the SQL the derive the dimension (2 basically) of the MultiPoint2D value.- Overrides:
doMultiPoint2DMeasurableDimensionsTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DGetBoundingBoxTransform
public String doMultiPoint2DGetBoundingBoxTransform(String first)
Description copied from class:DBDefinition
Provides the SQL the derive the bounding box containing all the points in the MultiPoint2D value.- Overrides:
doMultiPoint2DGetBoundingBoxTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DAsTextTransform
public String doMultiPoint2DAsTextTransform(String first)
Description copied from class:DBDefinition
Provides the SQL the transform the MultiPoint2D value into a WKT value.- Overrides:
doMultiPoint2DAsTextTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DToLine2DTransform
public String doMultiPoint2DToLine2DTransform(String first)
Description copied from class:DBDefinition
Provides the SQL the transform the MultiPoint2D value into aLine2DResult
value.- Overrides:
doMultiPoint2DToLine2DTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DGetMinYTransform
public String doMultiPoint2DGetMinYTransform(String first)
Description copied from class:DBDefinition
Provides the SQL that will derive the smallest Y value of all the points in the MultiPoint2D value- Overrides:
doMultiPoint2DGetMinYTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DGetMinXTransform
public String doMultiPoint2DGetMinXTransform(String first)
Description copied from class:DBDefinition
Provides the SQL that will derive the smallest X value of all the points in the MultiPoint2D value- Overrides:
doMultiPoint2DGetMinXTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DGetMaxYTransform
public String doMultiPoint2DGetMaxYTransform(String first)
Description copied from class:DBDefinition
Provides the SQL that will derive the largest Y value of all the points in the MultiPoint2D value- Overrides:
doMultiPoint2DGetMaxYTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
doMultiPoint2DGetMaxXTransform
public String doMultiPoint2DGetMaxXTransform(String first)
Description copied from class:DBDefinition
Provides the SQL that will derive the largest X value of all the points in the MultiPoint2D value- Overrides:
doMultiPoint2DGetMaxXTransform
in classDBDefinition
- Parameters:
first
- the MultiPoint2D value- Returns:
- SQL
-
getTrueValue
public String getTrueValue()
Description copied from class:DBDefinition
The value used for TRUE boolean values.The default method returns " TRUE ".
- Overrides:
getTrueValue
in classDBDefinition
- Returns:
- " TRUE "
-
getFalseValue
public String getFalseValue()
Description copied from class:DBDefinition
The value used for FALSE boolean values.The default method returns " FALSE ".
- Overrides:
getFalseValue
in classDBDefinition
- Returns:
- " FALSE "
-
preferredLargeObjectWriter
public LargeObjectHandlerType preferredLargeObjectWriter(DBLargeObject<?> lob)
- Overrides:
preferredLargeObjectWriter
in classDBDefinition
-
preferredLargeObjectReader
public LargeObjectHandlerType preferredLargeObjectReader(DBLargeObject<?> lob)
- Overrides:
preferredLargeObjectReader
in classDBDefinition
-
getRoundUpFunctionName
public String getRoundUpFunctionName()
Return the function name for the RoundUp function.For MS SQLServer this method returns ceiling
Support DBvolution at Patreon
- Overrides:
getRoundUpFunctionName
in classDBDefinition
- Returns:
- the name of the function to use when rounding numbers up
-
getNaturalLogFunctionName
public String getNaturalLogFunctionName()
Return the function name for the Natural Logarithm function.For SQLServer this method returns log
Support DBvolution at Patreon
- Overrides:
getNaturalLogFunctionName
in classDBDefinition
- Returns:
- the name of the function to use when rounding numbers up
-
getLogBase10FunctionName
public String getLogBase10FunctionName()
Return the function name for the Logarithm Base10 function.By default this method returns log10
Support DBvolution at Patreon
- Overrides:
getLogBase10FunctionName
in classDBDefinition
- Returns:
- the name of the function to use when rounding numbers up
-
doRandomNumberTransform
public String doRandomNumberTransform()
Returns the required code to generate a random number.For each call of this method a new random number is generated.
This method DOES NOT use the SQLServer built-in function as it does not produce a different result for different rows in a single query.
Support DBvolution at Patreon
- Overrides:
doRandomNumberTransform
in classDBDefinition
- Returns:
- random number generating code
-
doFindNumberInStringTransform
public String doFindNumberInStringTransform(String toSQLString)
- Overrides:
doFindNumberInStringTransform
in classDBDefinition
-
doFindIntegerInStringTransform
public String doFindIntegerInStringTransform(String toSQLString)
- Overrides:
doFindIntegerInStringTransform
in classDBDefinition
-
getInsertPreparation
public Collection<? extends String> getInsertPreparation(DBRow table)
- Overrides:
getInsertPreparation
in classDBDefinition
-
getInsertCleanUp
public Collection<? extends String> getInsertCleanUp(DBRow table)
- Overrides:
getInsertCleanUp
in classDBDefinition
-
getAlterTableAddColumnSQL
public String getAlterTableAddColumnSQL(DBRow existingTable, PropertyWrapper<?,?,?> columnPropertyWrapper)
- Overrides:
getAlterTableAddColumnSQL
in classDBDefinition
-
supportsNullsOrderingStandard
public boolean supportsNullsOrderingStandard()
- Overrides:
supportsNullsOrderingStandard
in classDBDefinition
-
doStringAccumulateTransform
public String doStringAccumulateTransform(String accumulateColumn, String separator, String referencedTable)
- Overrides:
doStringAccumulateTransform
in classDBDefinition
-
doStringAccumulateTransform
public String doStringAccumulateTransform(String accumulateColumn, String separator, String orderByColumnName, String referencedTable)
- Overrides:
doStringAccumulateTransform
in classDBDefinition
-
requiresClosedPolygons
public boolean requiresClosedPolygons()
- Overrides:
requiresClosedPolygons
in classDBDefinition
-
requiresOnClauseForAllJoins
public boolean requiresOnClauseForAllJoins()
- Overrides:
requiresOnClauseForAllJoins
in classDBDefinition
-
requiresReversingLineStringsFromDatabase
public boolean requiresReversingLineStringsFromDatabase()
- Overrides:
requiresReversingLineStringsFromDatabase
in classDBDefinition
-
transformDatabaseLine2DValueToJTSLineString
public com.vividsolutions.jts.geom.LineString transformDatabaseLine2DValueToJTSLineString(String lineStringAsSQL) throws com.vividsolutions.jts.io.ParseException
Description copied from class:DBDefinition
From the database's representation of a Lin2D create a JTS LineString.This is the inverse of
DBDefinition.transformPolygonIntoDatabasePolygon2DFormat(com.vividsolutions.jts.geom.Polygon)
.- Overrides:
transformDatabaseLine2DValueToJTSLineString
in classDBDefinition
- Parameters:
lineStringAsSQL
- a line2d value- Returns:
- a linestring created from the line2d
- Throws:
com.vividsolutions.jts.io.ParseException
- if the database result is not a valid WKT
-
getDefaultOrderingClause
public String getDefaultOrderingClause()
- Overrides:
getDefaultOrderingClause
in classDBDefinition
-
supportsDurationNatively
public boolean supportsDurationNatively()
- Overrides:
supportsDurationNatively
in classDBDefinition
-
supportsDateRepeatDatatypeFunctions
public boolean supportsDateRepeatDatatypeFunctions()
- Overrides:
supportsDateRepeatDatatypeFunctions
in classDBDefinition
-
isDuplicateColumnException
public boolean isDuplicateColumnException(Exception exc)
- Overrides:
isDuplicateColumnException
in classDBDefinition
-
-