Class PostgresDBDefinition

  • All Implemented Interfaces:
    java.io.Serializable

    public class PostgresDBDefinition
    extends DBDefinition
    Defines the features of the PostgreSQL database that differ from the standard database.

    This DBDefinition is automatically included in PostgresDB and PostgresDBOverSSL instances, and you should not need to use it directly.

    Support DBvolution at Patreon

    Author:
    Gregory Graham
    See Also:
    Serialized Form
    • Constructor Detail

      • PostgresDBDefinition

        public PostgresDBDefinition()
    • Method Detail

      • getDropDatabase

        public java.lang.String getDropDatabase​(java.lang.String databaseName)
                                         throws java.lang.UnsupportedOperationException
        Description copied from class: DBDefinition
        Provides the SQL statement required to drop the named database.
        Overrides:
        getDropDatabase in class DBDefinition
        Parameters:
        databaseName - databaseName

        Support DBvolution at Patreon

        Returns:
        the default implementation does not support dropping databases.
        Throws:
        java.lang.UnsupportedOperationException
      • formatPrimaryKeyForRetrievingGeneratedKeys

        public java.lang.String formatPrimaryKeyForRetrievingGeneratedKeys​(java.lang.String primaryKeyColumnName)
        Description copied from class: DBDefinition
        Allows the database to have a different format for the primary key column name.

        Most databases do not have a problem with this method but PostgreSQL likes the column name to be lowercase in this particular instance.

        Overrides:
        formatPrimaryKeyForRetrievingGeneratedKeys in class DBDefinition
        Parameters:
        primaryKeyColumnName - the name of the primary key column formatted for this database

        Support DBvolution at Patreon

        Returns:
        the Primary Key formatted for this database.
      • formatNameForDatabase

        protected java.lang.String formatNameForDatabase​(java.lang.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 class DBDefinition
        Parameters:
        sqlObjectName - the Java object name to be transformed into a database object name.

        Support DBvolution at Patreon

        Returns:
        the object name formatted for use with this database
      • getDateFormattedForQuery

        public java.lang.String getDateFormattedForQuery​(java.util.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 class DBDefinition
        Parameters:
        date - date

        Support DBvolution at Patreon

        Returns:
        the date formatted as a string that the database will correctly interpret as a date.
      • getLocalDatePartsFormattedForQuery

        public java.lang.String getLocalDatePartsFormattedForQuery​(java.lang.String years,
                                                                   java.lang.String months,
                                                                   java.lang.String days,
                                                                   java.lang.String hours,
                                                                   java.lang.String minutes,
                                                                   java.lang.String seconds,
                                                                   java.lang.String subsecond,
                                                                   java.lang.String timeZoneSign,
                                                                   java.lang.String timeZoneHourOffset,
                                                                   java.lang.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') "

        Overrides:
        getLocalDatePartsFormattedForQuery in class DBDefinition
        Parameters:
        years - the sql representing the years part of the date
        months - the sql representing the months (1-12) part of the date
        days - the sql representing the days (0-31) part of the date
        hours - the sql representing the hours (0-24) part of the date
        minutes - the sql representing the minutes (0-60) part of the date
        seconds - the sql representing the seconds (0-59) part of the date
        subsecond - the sql representing the subsecond (0.0-0.9999) part of the date, precision is based on the database's limitations
        timeZoneSign - + or -
        timeZoneHourOffset - the sql representing the minutes (0-59) part of the date's time zone

        Support DBvolution at Patreon

        timeZoneMinuteOffSet - 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.
      • getDatePartsFormattedForQuery

        public java.lang.String getDatePartsFormattedForQuery​(java.lang.String years,
                                                              java.lang.String months,
                                                              java.lang.String days,
                                                              java.lang.String hours,
                                                              java.lang.String minutes,
                                                              java.lang.String seconds,
                                                              java.lang.String subsecond,
                                                              java.lang.String timeZoneSign,
                                                              java.lang.String timeZoneHourOffset,
                                                              java.lang.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 class DBDefinition
        Parameters:
        years - the sql representing the years part of the date
        months - the sql representing the months (1-12) part of the date
        days - the sql representing the days (0-31) part of the date
        hours - the sql representing the hours (0-24) part of the date
        minutes - the sql representing the minutes (0-60) part of the date
        seconds - the sql representing the seconds (0-59) part of the date
        subsecond - the sql representing the subsecond (0.0-0.9999) part of the date, precision is based on the database's limitations
        timeZoneSign - + or -
        timeZoneHourOffset - the sql representing the minutes (0-59) part of the date's time zone

        Support DBvolution at Patreon

        timeZoneMinuteOffSet - 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.
      • getDatabaseDataTypeOfQueryableDatatype

        public java.lang.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 class DBDefinition
        Parameters:
        qdt - qdt

        Support DBvolution at Patreon

        Returns:
        the databases type for the QDT as a string
      • getQueryableDatatypeClassForSQLDatatype

        public java.lang.Class<? extends QueryableDatatype<?>> getQueryableDatatypeClassForSQLDatatype​(java.lang.String typeName)
        Description copied from class: DBDefinition
        Returns the QueryableDatatype class to be used with the named database specific datatype.

        This method is called during DBTableClassGenerator to resolve data types that JDBC doesn't recognize into a QDT. In particular anything that JDBC reports as Types.OTHER will be resolved using this method.

        The default method returns NULL which causes the generator to use a DBJavaObject.

        Overrides:
        getQueryableDatatypeClassForSQLDatatype in class DBDefinition
        Parameters:
        typeName - the name of the SQL data type as reported by JDBC

        Support DBvolution at Patreon

        Returns:
        the class of the QDT that can be used with this columns of this type name.
      • doTruncTransform

        public java.lang.String doTruncTransform​(java.lang.String firstString,
                                                 java.lang.String secondString)
        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 class DBDefinition
        Parameters:
        firstString - realNumberExpression
        secondString - numberOfDecimalPlacesExpression

        Support DBvolution at Patreon

        Returns:
        an expression that reduces the realNumberExpression to only the number of decimal places in numberOfDecimalPlacesExpression.
      • doBooleanToIntegerTransform

        public java.lang.String doBooleanToIntegerTransform​(java.lang.String columnName)
        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 class DBDefinition
        Parameters:
        columnName - bitExpression

        Support DBvolution at Patreon

        Returns:
        the transformation necessary to transform bitExpression into an integer expression in the SQL.
      • doIntegerToBitTransform

        public java.lang.String doIntegerToBitTransform​(java.lang.String columnName)
        Description copied from class: DBDefinition
        Transforms a integer expression into an bit expression.

        Used to allow comparison of integer columns in some databases.

        Overrides:
        doIntegerToBitTransform in class DBDefinition
        Parameters:
        columnName - bitExpression

        Support DBvolution at Patreon

        Returns:
        the transformation necessary to transform bitExpression into an integer expression in the SQL.
      • doBitsValueTransform

        public java.lang.String doBitsValueTransform​(boolean[] boolArray)
        Description copied from class: DBDefinition
        Convert the boolean array of bit values into the SQL equivalent.
        Overrides:
        doBitsValueTransform in class DBDefinition
        Parameters:
        boolArray - booleanArray

        Support DBvolution at Patreon

        Returns:
        SQL snippet.
      • getColumnAutoIncrementSuffix

        public java.lang.String getColumnAutoIncrementSuffix()
        Description copied from class: DBDefinition
        Returns the suffix added to a column definition to support auto-incrementing a column.

        Support DBvolution at Patreon

        Overrides:
        getColumnAutoIncrementSuffix in class DBDefinition
        Returns:
        " GENERATED BY DEFAULT AS IDENTITY "
      • hasSpecialAutoIncrementType

        protected boolean hasSpecialAutoIncrementType()
        Description copied from class: DBDefinition
        Indicates whether the database uses a special type for it's auto-increment columns.

        Support DBvolution at Patreon

        Overrides:
        hasSpecialAutoIncrementType in class DBDefinition
        Returns:
        the default implementation returns FALSE.
      • getSpecialAutoIncrementType

        protected java.lang.String getSpecialAutoIncrementType()
        Description copied from class: DBDefinition
        Provides the special auto-increment type used by this database if it has one.

        Support DBvolution at Patreon

        Overrides:
        getSpecialAutoIncrementType in class DBDefinition
        Returns:
        the default implementation returns ""
      • supportsModulusFunction

        public boolean supportsModulusFunction()
        Description copied from class: DBDefinition
        Indicates whether the database supports the modulus function.

        Support DBvolution at Patreon

        Overrides:
        supportsModulusFunction in class DBDefinition
        Returns:
        the default implementation returns TRUE.
      • doSubsecondTransform

        public java.lang.String doSubsecondTransform​(java.lang.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 class DBDefinition
        Parameters:
        dateExpression - the date from which to get the subsecond part of.

        Support DBvolution at Patreon

        Returns:
        SQL
      • doDateAddSecondsTransform

        public java.lang.String doDateAddSecondsTransform​(java.lang.String dateValue,
                                                          java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfSeconds - numberOfSeconds

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddMinutesTransform

        public java.lang.String doDateAddMinutesTransform​(java.lang.String dateValue,
                                                          java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfMinutes - numberOfMinutes

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddDaysTransform

        public java.lang.String doDateAddDaysTransform​(java.lang.String dateValue,
                                                       java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfDays - numberOfDays

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddHoursTransform

        public java.lang.String doDateAddHoursTransform​(java.lang.String dateValue,
                                                        java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfHours - numberOfHours

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddWeeksTransform

        public java.lang.String doDateAddWeeksTransform​(java.lang.String dateValue,
                                                        java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfWeeks

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddMonthsTransform

        public java.lang.String doDateAddMonthsTransform​(java.lang.String dateValue,
                                                         java.lang.String numberOfWeeks)
        Description copied from class: DBDefinition
        Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.
        Overrides:
        doDateAddMonthsTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfMonths

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doDateAddYearsTransform

        public java.lang.String doDateAddYearsTransform​(java.lang.String dateValue,
                                                        java.lang.String numberOfWeeks)
        Description copied from class: DBDefinition
        Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.
        Overrides:
        doDateAddYearsTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfYears

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddSecondsTransform

        public java.lang.String doInstantAddSecondsTransform​(java.lang.String dateValue,
                                                             java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfSeconds - numberOfSeconds

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddMinutesTransform

        public java.lang.String doInstantAddMinutesTransform​(java.lang.String dateValue,
                                                             java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfMinutes - numberOfMinutes

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddDaysTransform

        public java.lang.String doInstantAddDaysTransform​(java.lang.String dateValue,
                                                          java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfDays - numberOfDays

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddHoursTransform

        public java.lang.String doInstantAddHoursTransform​(java.lang.String dateValue,
                                                           java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfHours - numberOfHours

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddWeeksTransform

        public java.lang.String doInstantAddWeeksTransform​(java.lang.String dateValue,
                                                           java.lang.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 class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfWeeks

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddMonthsTransform

        public java.lang.String doInstantAddMonthsTransform​(java.lang.String dateValue,
                                                            java.lang.String numberOfWeeks)
        Description copied from class: DBDefinition
        Does the required transformation to produce an SQL snippet that adds numberOfMonths months to the dateValue.
        Overrides:
        doInstantAddMonthsTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfMonths

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doInstantAddYearsTransform

        public java.lang.String doInstantAddYearsTransform​(java.lang.String dateValue,
                                                           java.lang.String numberOfWeeks)
        Description copied from class: DBDefinition
        Does the required transformation to produce an SQL snippet that adds numberOfYears years to the dateValue.
        Overrides:
        doInstantAddYearsTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        numberOfWeeks - numberOfYears

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doBooleanValueTransform

        public java.lang.String doBooleanValueTransform​(java.lang.Boolean boolValue)
        Description copied from class: DBDefinition
        Transform a Java Boolean into the equivalent in an SQL snippet.
        Overrides:
        doBooleanValueTransform in class DBDefinition
        Parameters:
        boolValue - boolValue

        Support DBvolution at Patreon

        Returns:
        an SQL snippet
      • doCurrentDateOnlyTransform

        public java.lang.String doCurrentDateOnlyTransform()
        Description copied from class: DBDefinition
        Creates the CURRENTDATE function for this database.

        Support DBvolution at Patreon

        Overrides:
        doCurrentDateOnlyTransform in class DBDefinition
        Returns:
        a String of the SQL required to get the CurrentDateOnly value.
      • doDayDifferenceTransform

        public java.lang.String doDayDifferenceTransform​(java.lang.String dateValue,
                                                         java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in days.
        Overrides:
        doDayDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doWeekDifferenceTransform

        public java.lang.String doWeekDifferenceTransform​(java.lang.String dateValue,
                                                          java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in days.
        Overrides:
        doWeekDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMonthDifferenceTransform

        public java.lang.String doMonthDifferenceTransform​(java.lang.String dateValue,
                                                           java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in months.
        Overrides:
        doMonthDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doYearDifferenceTransform

        public java.lang.String doYearDifferenceTransform​(java.lang.String dateValue,
                                                          java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in years.
        Overrides:
        doYearDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doHourDifferenceTransform

        public java.lang.String doHourDifferenceTransform​(java.lang.String dateValue,
                                                          java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in hours.
        Overrides:
        doHourDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMinuteDifferenceTransform

        public java.lang.String doMinuteDifferenceTransform​(java.lang.String dateValue,
                                                            java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in minutes.
        Overrides:
        doMinuteDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doSecondDifferenceTransform

        public java.lang.String doSecondDifferenceTransform​(java.lang.String dateValue,
                                                            java.lang.String otherDateValue)
        Description copied from class: DBDefinition
        Convert the 2 SQL date values into a difference in whole seconds.
        Overrides:
        doSecondDifferenceTransform in class DBDefinition
        Parameters:
        dateValue - dateValue
        otherDateValue - otherDateValue

        Support DBvolution at Patreon

        Returns:
        SQL
      • doDayOfWeekTransform

        public java.lang.String doDayOfWeekTransform​(java.lang.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 class DBDefinition
        Parameters:
        dateSQL - the date to get the day of the week for.

        Support DBvolution at Patreon

        Returns:
        a number between 1 and 7 for the weekday.
      • doInstantDayOfWeekTransform

        public java.lang.String doInstantDayOfWeekTransform​(java.lang.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 class DBDefinition
        Parameters:
        dateSQL - the date to get the day of the week for.

        Support DBvolution at Patreon

        Returns:
        a number between 1 and 7 for the weekday.
      • doBooleanArrayTransform

        public java.lang.String doBooleanArrayTransform​(java.lang.Boolean[] bools)
        Description copied from class: DBDefinition
        Transforms the array of booleans into the database format.

        The default implementation changes the array into a string of 0s and 1s.

        Overrides:
        doBooleanArrayTransform in class DBDefinition
        Parameters:
        bools - all the true/false values

        Support DBvolution at Patreon

        Returns:
        a string of 1s and 0s representing the boolean array.
      • doPolygon2DIntersectionTransform

        public java.lang.String doPolygon2DIntersectionTransform​(java.lang.String firstGeometry,
                                                                 java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Creates a Polygon2D representing the intersection of the Polygon2Ds.
        Overrides:
        doPolygon2DIntersectionTransform in class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value
        secondGeometry - the second polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL that represents a polygon of the intersection, null if there is no intersection.
      • doPolygon2DOverlapsTransform

        public java.lang.String doPolygon2DOverlapsTransform​(java.lang.String firstGeometry,
                                                             java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Test whether the 2 polygons intersect but not contained or within.
        Overrides:
        doPolygon2DOverlapsTransform in class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value to compare
        secondGeometry - the second polygon2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL that is TRUE if the polygons have intersecting and non-intersecting parts.
      • doPolygon2DIntersectsTransform

        public java.lang.String doPolygon2DIntersectsTransform​(java.lang.String firstGeometry,
                                                               java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Test whether the 2 polygons intersect.
        Overrides:
        doPolygon2DIntersectsTransform in class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value to compare
        secondGeometry - the second polygon2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL that returns TRUE if they intersect.
      • doPolygon2DTouchesTransform

        public java.lang.String doPolygon2DTouchesTransform​(java.lang.String firstGeometry,
                                                            java.lang.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 class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value to compare
        secondGeometry - the second polygon2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL snippet
      • doPolygon2DGetAreaTransform

        public java.lang.String doPolygon2DGetAreaTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Retrieve the area of the polygon.
        Overrides:
        doPolygon2DGetAreaTransform in class DBDefinition
        Parameters:
        toSQLString - a polygon2D value

        Support DBvolution at Patreon

        Returns:
        SQL that will return the area of the Polygon2D
      • doPolygon2DGetBoundingBoxTransform

        public java.lang.String doPolygon2DGetBoundingBoxTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Create a simple four sided bounding for the polygon.
        Overrides:
        doPolygon2DGetBoundingBoxTransform in class DBDefinition
        Parameters:
        toSQLString - a polygon2D value

        Support DBvolution at Patreon

        Returns:
        the SQL required to create a bounding box for the polygon.
      • doPolygon2DEqualsTransform

        public java.lang.String doPolygon2DEqualsTransform​(java.lang.String firstGeometry,
                                                           java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Compare 2 polygons with EQUALS.
        Overrides:
        doPolygon2DEqualsTransform in class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value to compare
        secondGeometry - the second polygon2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DContainsPolygon2DTransform

        public java.lang.String doPolygon2DContainsPolygon2DTransform​(java.lang.String firstGeometry,
                                                                      java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Test whether the first polygon completely contains the second polygon.
        Overrides:
        doPolygon2DContainsPolygon2DTransform in class DBDefinition
        Parameters:
        firstGeometry - the first polygon2d value to compare
        secondGeometry - the second polygon2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL that is TRUE if the first polygon contains the second.
      • doPolygon2DContainsPoint2DTransform

        public java.lang.String doPolygon2DContainsPoint2DTransform​(java.lang.String firstGeometry,
                                                                    java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Generates the SQL to determine whether the first (polygon) argument contains the second point argument.
        Overrides:
        doPolygon2DContainsPoint2DTransform in class DBDefinition
        Parameters:
        firstGeometry - the polygon2d to compare with
        secondGeometry - the point2d value that might be inside the polygon2d

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DMeasurableDimensionsTransform

        public java.lang.String doPolygon2DMeasurableDimensionsTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Returns the dimension of the polygon.

        This will be "2"

        Overrides:
        doPolygon2DMeasurableDimensionsTransform in class DBDefinition
        Parameters:
        toSQLString - a polygon2d value

        Support DBvolution at Patreon

        Returns:
        "2" unless something has gone horribly wrong.
      • doPolygon2DGetExteriorRingTransform

        public java.lang.String doPolygon2DGetExteriorRingTransform​(java.lang.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 class DBDefinition
        Parameters:
        polygon2DSQL - a polygon2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DGetMaxXTransform

        public java.lang.String doPolygon2DGetMaxXTransform​(java.lang.String polygon2DSQL)
        Description copied from class: DBDefinition
        Generate the SQL that will return the largest X value within the Polygon2D expression.
        Overrides:
        doPolygon2DGetMaxXTransform in class DBDefinition
        Parameters:
        polygon2DSQL - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DGetMinXTransform

        public java.lang.String doPolygon2DGetMinXTransform​(java.lang.String polygon2DSQL)
        Description copied from class: DBDefinition
        Generate the SQL that will return the smallest X value within the Polygon2D expression.
        Overrides:
        doPolygon2DGetMinXTransform in class DBDefinition
        Parameters:
        polygon2DSQL - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DGetMaxYTransform

        public java.lang.String doPolygon2DGetMaxYTransform​(java.lang.String polygon2DSQL)
        Description copied from class: DBDefinition
        Generate the SQL that will return the largest X value within the Polygon2D expression.
        Overrides:
        doPolygon2DGetMaxYTransform in class DBDefinition
        Parameters:
        polygon2DSQL - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DGetMinYTransform

        public java.lang.String doPolygon2DGetMinYTransform​(java.lang.String polygon2DSQL)
        Description copied from class: DBDefinition
        Generate the SQL that will return the smallest Y value within the Polygon2D expression.
        Overrides:
        doPolygon2DGetMinYTransform in class DBDefinition
        Parameters:
        polygon2DSQL - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPolygon2DAsTextTransform

        public java.lang.String doPolygon2DAsTextTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Generates the SQL to convert the polygon to the standard text version of a polygon.
        Overrides:
        doPolygon2DAsTextTransform in class DBDefinition
        Parameters:
        toSQLString - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • supportsHyperbolicFunctionsNatively

        public boolean supportsHyperbolicFunctionsNatively()
        Description copied from class: DBDefinition
        Indicates that this database supports hyperbolic functions natively.

        Support DBvolution at Patreon

        Overrides:
        supportsHyperbolicFunctionsNatively in class DBDefinition
        Returns:
        TRUE by default.
      • doStringToNumberTransform

        public java.lang.String doStringToNumberTransform​(java.lang.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 class DBDefinition
        Parameters:
        stringResultContainingANumber - a number value to be coerced to string

        Support DBvolution at Patreon

        Returns:
        SQL that converts the string value into number.
      • supportsArcSineFunction

        public boolean supportsArcSineFunction()
        Description copied from class: DBDefinition
        Indicates that the database supports the ARCSINE function.

        Support DBvolution at Patreon

        Overrides:
        supportsArcSineFunction in class DBDefinition
        Returns:
        true by default.
      • doPoint2DEqualsTransform

        public java.lang.String doPoint2DEqualsTransform​(java.lang.String firstPoint,
                                                         java.lang.String secondPoint)
        Description copied from class: DBDefinition
        Provide the SQL to compare 2 Point2Ds
        Overrides:
        doPoint2DEqualsTransform in class DBDefinition
        Parameters:
        firstPoint - a point2d value to compare
        secondPoint - a point2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPoint2DGetXTransform

        public java.lang.String doPoint2DGetXTransform​(java.lang.String point2D)
        Description copied from class: DBDefinition
        Provide the SQL to return the X coordinate of the Point2D
        Overrides:
        doPoint2DGetXTransform in class DBDefinition
        Parameters:
        point2D - a point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPoint2DGetYTransform

        public java.lang.String doPoint2DGetYTransform​(java.lang.String point2D)
        Description copied from class: DBDefinition
        Provide the SQL to return the Y coordinate of the Point2D
        Overrides:
        doPoint2DGetYTransform in class DBDefinition
        Parameters:
        point2D - a point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPoint2DMeasurableDimensionsTransform

        public java.lang.String doPoint2DMeasurableDimensionsTransform​(java.lang.String point2D)
        Description copied from class: DBDefinition
        Provide the SQL to return the dimension of the Point2D

        Point is a 0-dimensional objects for this purpose.

        Overrides:
        doPoint2DMeasurableDimensionsTransform in class DBDefinition
        Parameters:
        point2D - a point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPoint2DGetBoundingBoxTransform

        public java.lang.String doPoint2DGetBoundingBoxTransform​(java.lang.String point2D)
        Description copied from class: DBDefinition
        Provide the SQL to derive the Polygon2D representing the Bounding Box of the Point2D.
        Overrides:
        doPoint2DGetBoundingBoxTransform in class DBDefinition
        Parameters:
        point2D - a point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doPoint2DAsTextTransform

        public java.lang.String doPoint2DAsTextTransform​(java.lang.String point2DString)
        Description copied from class: DBDefinition
        Provide the SQL to derive the WKT version of the Point2D.
        Overrides:
        doPoint2DAsTextTransform in class DBDefinition
        Parameters:
        point2DString - a point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • transformPoint2DIntoDatabaseFormat

        public java.lang.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 class DBDefinition
        Parameters:
        point - a point to be turned into an SQL point2d value.

        Support DBvolution at Patreon

        Returns:
        SQL
      • transformLineStringIntoDatabaseLine2DFormat

        public java.lang.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 class DBDefinition
        Parameters:
        line - a linestring to transform in to a Line2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doColumnTransformForSelect

        public java.lang.String doColumnTransformForSelect​(QueryableDatatype<?> qdt,
                                                           java.lang.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 class DBDefinition
        Parameters:
        qdt - the DBV value to be stored
        selectableName - the selectable value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DEqualsTransform

        public java.lang.String doLine2DEqualsTransform​(java.lang.String firstLineSQL,
                                                        java.lang.String secondLineSQL)
        Description copied from class: DBDefinition
        Transform the 2 Line2D SQL snippets into an EQUALS comparison of the 2
        Overrides:
        doLine2DEqualsTransform in class DBDefinition
        Parameters:
        firstLineSQL - the first line2d value to compare
        secondLineSQL - the second line2d value to compare

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DAsTextTransform

        public java.lang.String doLine2DAsTextTransform​(java.lang.String line2DSQL)
        Description copied from class: DBDefinition
        Provide the SQL to derive the WKT version of the Line2D.
        Overrides:
        doLine2DAsTextTransform in class DBDefinition
        Parameters:
        line2DSQL - a line2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DGetBoundingBoxTransform

        public java.lang.String doLine2DGetBoundingBoxTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Create the SQL to derive the bounding box of this Line2D SQL
        Overrides:
        doLine2DGetBoundingBoxTransform in class DBDefinition
        Parameters:
        toSQLString - the line2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DGetMaxXTransform

        public java.lang.String doLine2DGetMaxXTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Generate the SQL that will return the largest X value within the Line2D expression.
        Overrides:
        doLine2DGetMaxXTransform in class DBDefinition
        Parameters:
        toSQLString - the line2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DGetMinXTransform

        public java.lang.String doLine2DGetMinXTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Generate the SQL that will return the smallest X value within the Line2D expression.
        Overrides:
        doLine2DGetMinXTransform in class DBDefinition
        Parameters:
        toSQLString - the line2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DGetMaxYTransform

        public java.lang.String doLine2DGetMaxYTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Generate the SQL that will return the largest Y value within the Line2D expression.
        Overrides:
        doLine2DGetMaxYTransform in class DBDefinition
        Parameters:
        toSQLString - the line2 value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DGetMinYTransform

        public java.lang.String doLine2DGetMinYTransform​(java.lang.String toSQLString)
        Description copied from class: DBDefinition
        Generate the SQL that will return the smallest Y value within the Line2D expression.
        Overrides:
        doLine2DGetMinYTransform in class DBDefinition
        Parameters:
        toSQLString - the line2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLine2DIntersectsLine2DTransform

        public java.lang.String doLine2DIntersectsLine2DTransform​(java.lang.String firstGeometry,
                                                                  java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Generates the SQL required to find whether the 2 lines cross at any point.
        Overrides:
        doLine2DIntersectsLine2DTransform in class DBDefinition
        Parameters:
        firstGeometry - the first line2d value to compare
        secondGeometry - the second line2d value to compare

        Support DBvolution at Patreon

        Returns:
        an SQL expression that will evaluate to TRUE FALSE or NULL, depending on whether the lines cross at any point.
      • doLine2DIntersectionPointWithLine2DTransform

        public java.lang.String doLine2DIntersectionPointWithLine2DTransform​(java.lang.String firstGeometry,
                                                                             java.lang.String secondGeometry)
        Description copied from class: DBDefinition
        Generate the SQL required to find the intersection point of the 2 line segment SQL expressions.
        Overrides:
        doLine2DIntersectionPointWithLine2DTransform in class DBDefinition
        Parameters:
        firstGeometry - the first line2d to compare
        secondGeometry - the second line2d to compare

        Support DBvolution at Patreon

        Returns:
        an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
      • doLine2DAllIntersectionPointsWithLine2DTransform

        public java.lang.String doLine2DAllIntersectionPointsWithLine2DTransform​(java.lang.String firstGeometry,
                                                                                 java.lang.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 class DBDefinition
        Parameters:
        firstGeometry - the first line2d to compare
        secondGeometry - the second line2d to compare

        Support DBvolution at Patreon

        Returns:
        an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
      • doSubstringBeforeTransform

        public java.lang.String doSubstringBeforeTransform​(java.lang.String fromThis,
                                                           java.lang.String beforeThis)
        Description copied from class: DBDefinition
        Generate the SQL to use the SUBSTRING_BEFORE function with the 2 String expressions.
        Overrides:
        doSubstringBeforeTransform in class DBDefinition
        Parameters:
        fromThis - the string value to be dissected
        beforeThis - the string value that indicates the end of the required text. Not included in the returned value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doSubstringAfterTransform

        public java.lang.String doSubstringAfterTransform​(java.lang.String fromThis,
                                                          java.lang.String afterThis)
        Description copied from class: DBDefinition
        Generate the SQL to use the SUBSTRING_AFTER function with the 2 String expressions.
        Overrides:
        doSubstringAfterTransform in class DBDefinition
        Parameters:
        fromThis - the string value to be dissected
        afterThis - the string value that indicates the beginning of the required text. Not included in the returned value.

        Support DBvolution at Patreon

        Returns:
        SQL
      • transformPolygonIntoDatabasePolygon2DFormat

        public java.lang.String transformPolygonIntoDatabasePolygon2DFormat​(com.vividsolutions.jts.geom.Polygon polygon)
        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 class DBDefinition
        Parameters:
        polygon - the polygon2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • transformCoordinateArrayToDatabasePolygon2DFormat

        public java.lang.String transformCoordinateArrayToDatabasePolygon2DFormat​(java.util.List<java.lang.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 class DBDefinition
        Parameters:
        coordinateSQL - lots of numbers

        Support DBvolution at Patreon

        Returns:
        a polygon2d value
      • transformPoint2DArrayToDatabasePolygon2DFormat

        public java.lang.String transformPoint2DArrayToDatabasePolygon2DFormat​(java.util.List<java.lang.String> pointSQL)
        Description copied from class: DBDefinition
        Create the SQL to transform a Point2DArray SQL into a Polygon2D
        Overrides:
        transformPoint2DArrayToDatabasePolygon2DFormat in class DBDefinition
        Parameters:
        pointSQL - the point2d value

        Support DBvolution at Patreon

        Returns:
        SQL
      • 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 class DBDefinition
        Parameters:
        columnExpression - a column expression that might need to change type for this database

        Support DBvolution at Patreon

        Returns:
        The DBExpression as a DBExpression supported by the database.
      • transformLineSegmentIntoDatabaseLineSegment2DFormat

        public java.lang.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 class DBDefinition
        Parameters:
        lineSegment - the LineSegment to convert to database format.

        Support DBvolution at Patreon

        Returns:
        an SQL expression that can be interpreted by the database as a line segment.
      • transformDatabaseLineSegment2DValueToJTSLineSegment

        public com.vividsolutions.jts.geom.LineSegment transformDatabaseLineSegment2DValueToJTSLineSegment​(java.lang.String lineStringAsString)
                                                                                                    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 class DBDefinition
        Parameters:
        lineStringAsString - the database linesegment2d value to create a JTS LineSegment with

        Support DBvolution at Patreon

        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
      • doLineSegment2DGetMaxXTransform

        public java.lang.String doLineSegment2DGetMaxXTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DGetMinXTransform

        public java.lang.String doLineSegment2DGetMinXTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DGetMaxYTransform

        public java.lang.String doLineSegment2DGetMaxYTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DGetMinYTransform

        public java.lang.String doLineSegment2DGetMinYTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DGetBoundingBoxTransform

        public java.lang.String doLineSegment2DGetBoundingBoxTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DNotEqualsTransform

        public java.lang.String doLineSegment2DNotEqualsTransform​(java.lang.String toSQLString,
                                                                  java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the first LineSegment2D value
        toSQLString0 - the second LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DEqualsTransform

        public java.lang.String doLineSegment2DEqualsTransform​(java.lang.String toSQLString,
                                                               java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the first LineSegment2D value
        toSQLString0 - the second LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DAsTextTransform

        public java.lang.String doLineSegment2DAsTextTransform​(java.lang.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 class DBDefinition
        Parameters:
        toSQLString - the LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doLineSegment2DIntersectionPointWithLineSegment2DTransform

        public java.lang.String doLineSegment2DIntersectionPointWithLineSegment2DTransform​(java.lang.String firstLineSegment,
                                                                                           java.lang.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 class DBDefinition
        Parameters:
        firstLineSegment - the first LineSegment2D value
        secondLineSegment - the second LineSegment2D value

        Support DBvolution at Patreon

        Returns:
        an SQL expression that will evaluate to the intersection point of the 2 line segments or NULL.
      • transformMultiPoint2DToDatabaseMultiPoint2DValue

        public java.lang.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 class DBDefinition
        Parameters:
        points - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • transformDatabaseMultiPoint2DValueToJTSMultiPoint

        public com.vividsolutions.jts.geom.MultiPoint transformDatabaseMultiPoint2DValueToJTSMultiPoint​(java.lang.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 class DBDefinition
        Parameters:
        pointsAsString - the MultiPoint2D value to create a JTS MultiPoint with.

        Support DBvolution at Patreon

        Returns:
        the MultiPoint2D as a JTS MultiPoint instance
        Throws:
        com.vividsolutions.jts.io.ParseException - malformed WKT values will throw an exception
      • doMultiPoint2DEqualsTransform

        public java.lang.String doMultiPoint2DEqualsTransform​(java.lang.String first,
                                                              java.lang.String second)
        Description copied from class: DBDefinition
        Provide the SQL to compare 2 MultiPoint2Ds using the equivalent of EQUALS.
        Overrides:
        doMultiPoint2DEqualsTransform in class DBDefinition
        Parameters:
        first - the first MultiPoint2D value to compare
        second - the second MultiPoint2D value to compare

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetPointAtIndexTransform

        public java.lang.String doMultiPoint2DGetPointAtIndexTransform​(java.lang.String first,
                                                                       java.lang.String index)
        Description copied from class: DBDefinition
        Provide the SQL to get point at the supplied index within the MultiPoint2D
        Overrides:
        doMultiPoint2DGetPointAtIndexTransform in class DBDefinition
        Parameters:
        first - the first MultiPoint2D value to retrieve a point from.
        index - the index at which the required point is at.

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetNumberOfPointsTransform

        public java.lang.String doMultiPoint2DGetNumberOfPointsTransform​(java.lang.String first)
        Description copied from class: DBDefinition
        Provides the SQL the derive the number of points in the multipoint2d value.
        Overrides:
        doMultiPoint2DGetNumberOfPointsTransform in class DBDefinition
        Parameters:
        first - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DMeasurableDimensionsTransform

        public java.lang.String doMultiPoint2DMeasurableDimensionsTransform​(java.lang.String first)
        Description copied from class: DBDefinition
        Provides the SQL the derive the dimension (2 basically) of the MultiPoint2D value.
        Overrides:
        doMultiPoint2DMeasurableDimensionsTransform in class DBDefinition
        Parameters:
        first - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetBoundingBoxTransform

        public java.lang.String doMultiPoint2DGetBoundingBoxTransform​(java.lang.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 class DBDefinition
        Parameters:
        first - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DAsTextTransform

        public java.lang.String doMultiPoint2DAsTextTransform​(java.lang.String first)
        Description copied from class: DBDefinition
        Provides the SQL the transform the MultiPoint2D value into a WKT value.
        Overrides:
        doMultiPoint2DAsTextTransform in class DBDefinition
        Parameters:
        first - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DToLine2DTransform

        public java.lang.String doMultiPoint2DToLine2DTransform​(java.lang.String first)
        Description copied from class: DBDefinition
        Provides the SQL the transform the MultiPoint2D value into a Line2DResult value.
        Overrides:
        doMultiPoint2DToLine2DTransform in class DBDefinition
        Parameters:
        first - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetMinYTransform

        public java.lang.String doMultiPoint2DGetMinYTransform​(java.lang.String toSQLString)
        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 class DBDefinition
        Parameters:
        toSQLString - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetMinXTransform

        public java.lang.String doMultiPoint2DGetMinXTransform​(java.lang.String toSQLString)
        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 class DBDefinition
        Parameters:
        toSQLString - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetMaxYTransform

        public java.lang.String doMultiPoint2DGetMaxYTransform​(java.lang.String toSQLString)
        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 class DBDefinition
        Parameters:
        toSQLString - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • doMultiPoint2DGetMaxXTransform

        public java.lang.String doMultiPoint2DGetMaxXTransform​(java.lang.String toSQLString)
        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 class DBDefinition
        Parameters:
        toSQLString - the MultiPoint2D value

        Support DBvolution at Patreon

        Returns:
        SQL
      • getLogBase10FunctionName

        public java.lang.String getLogBase10FunctionName()
        Return the function name for the Logarithm Base10 function.

        By default this method returns log10

        Support DBvolution at Patreon

        Overrides:
        getLogBase10FunctionName in class DBDefinition
        Returns:
        the name of the function to use when rounding numbers up
      • doLogBase10NumberTransform

        public java.lang.String doLogBase10NumberTransform​(java.lang.String sql)
        Description copied from class: DBDefinition
        Return the Natural Logarithm.

        By default this method returns log10(sql)

        Overrides:
        doLogBase10NumberTransform in class DBDefinition
        Parameters:
        sql -

        Support DBvolution at Patreon

        Returns:
        the name of the function to use when rounding numbers up
      • doRandomNumberTransform

        public java.lang.String doRandomNumberTransform()
        Description copied from class: DBDefinition
        Returns the required code to generate a random number.

        For each call of this method a new random number is generated.

        By default this method returns rand()

        Support DBvolution at Patreon

        Overrides:
        doRandomNumberTransform in class DBDefinition
        Returns:
        the name of the function to use when creating random numbers
      • getSequenceUpdateSQL

        public java.lang.String getSequenceUpdateSQL​(java.lang.String tableName,
                                                     java.lang.String columnName,
                                                     long primaryKeyGenerated)
        Overrides:
        getSequenceUpdateSQL in class DBDefinition
      • doStringAccumulateTransform

        public java.lang.String doStringAccumulateTransform​(java.lang.String accumulateColumn,
                                                            java.lang.String separator,
                                                            java.lang.String referencedTable)
        Overrides:
        doStringAccumulateTransform in class DBDefinition
      • doStringAccumulateTransform

        public java.lang.String doStringAccumulateTransform​(java.lang.String accumulateColumn,
                                                            java.lang.String separator,
                                                            java.lang.String orderByColumnName,
                                                            java.lang.String referencedTable)
        Overrides:
        doStringAccumulateTransform in class DBDefinition
      • doRoundWithDecimalPlacesTransform

        public java.lang.String doRoundWithDecimalPlacesTransform​(java.lang.String number,
                                                                  java.lang.String decimalPlaces)
        Generate the SQL to apply rounding to the Number expressions with the specified number of decimal places.
        Overrides:
        doRoundWithDecimalPlacesTransform in class DBDefinition
        Parameters:
        number - the number value
        decimalPlaces - the number value of the decimal places required.

        Support DBvolution at Patreon

        Returns:
        SQL
      • doCurrentUTCTimeTransform

        public java.lang.String doCurrentUTCTimeTransform()
        Creates the CURRENTTIME function for this database.

        Support DBvolution at Patreon

        Overrides:
        doCurrentUTCTimeTransform in class DBDefinition
        Returns:
        the default implementation returns " CURRENT_TIMESTAMP "
      • doInstantYearTransform

        public java.lang.String doInstantYearTransform​(java.lang.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.
        Overrides:
        doInstantYearTransform in class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the year of the supplied date.
      • doInstantMonthTransform

        public java.lang.String doInstantMonthTransform​(java.lang.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.
        Overrides:
        doInstantMonthTransform in class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the month of the supplied date.
      • doInstantDayTransform

        public java.lang.String doInstantDayTransform​(java.lang.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.

        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 class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the day of the supplied date.
      • doInstantHourTransform

        public java.lang.String doInstantHourTransform​(java.lang.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.
        Overrides:
        doInstantHourTransform in class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the hour of the supplied date.
      • doInstantMinuteTransform

        public java.lang.String doInstantMinuteTransform​(java.lang.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.
        Overrides:
        doInstantMinuteTransform in class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the minute of the supplied date.
      • doInstantSecondTransform

        public java.lang.String doInstantSecondTransform​(java.lang.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.
        Overrides:
        doInstantSecondTransform in class DBDefinition
        Parameters:
        dateExpression - dateExpression

        Support DBvolution at Patreon

        Returns:
        a SQL snippet that will produce the second of the supplied date.
      • doInstantSubsecondTransform

        public java.lang.String doInstantSubsecondTransform​(java.lang.String dateExpression)
        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 class DBDefinition
        Parameters:
        dateExpression - the date from which to get the subsecond part of.

        Support DBvolution at Patreon

        Returns:
        SQL