Package org.jooq.exception

Examples of org.jooq.exception.SQLDialectNotSupportedException


                break;
            }

            default:
                throw new SQLDialectNotSupportedException("UDTs not supported in dialect " + context.configuration().dialect());
        }
    }
View Full Code Here


                if (array.getDataType().getType().isArray() && array instanceof Param) {
                    return simulate();
                }

                else {
                    throw new SQLDialectNotSupportedException("ARRAY TABLE is not supported for " + configuration.dialect());
                }
            }
        }
    }
View Full Code Here

                ctx.keyword("table(").visit(function).sql(")");
                break;
            }

            default:
                throw new SQLDialectNotSupportedException("FUNCTION TABLE is not supported for " + ctx.configuration().dialect());
        }
    }
View Full Code Here

                    break;
                }

                // Some dialects can't really handle this clause. Emulation should be done in two steps
                case H2: {
                    throw new SQLDialectNotSupportedException("The ON DUPLICATE KEY UPDATE clause cannot be emulated for " + ctx.configuration().dialect());
                }

                // Some databases allow for emulating this clause using a MERGE statement
                /* [pro] xx
                xxxx xxxx
                xxxx xxxxxxxxx
                xxxx xxxxxxx
                xxxx xxxxxxxxxx
                xxxx xxxxxxx
                xx [/pro] */
                case HSQLDB: {
                    ctx.visit(toMerge(ctx.configuration()));
                    break;
                }

                default:
                    throw new SQLDialectNotSupportedException("The ON DUPLICATE KEY UPDATE clause cannot be emulated for " + ctx.configuration().dialect());
            }
        }

        // ON DUPLICATE KEY IGNORE clause
        // ------------------------------
        else if (onDuplicateKeyIgnore) {
            switch (ctx.configuration().dialect().family()) {

                // MySQL has a nice, native syntax for this
                case MARIADB:
                case MYSQL: {
                    toSQLInsert(ctx);
                    ctx.start(INSERT_ON_DUPLICATE_KEY_UPDATE)
                       .end(INSERT_ON_DUPLICATE_KEY_UPDATE);
                    break;
                }

                // CUBRID can simulate this using ON DUPLICATE KEY UPDATE
                case CUBRID: {
                    FieldMapForUpdate update = new FieldMapForUpdate(INSERT_ON_DUPLICATE_KEY_UPDATE_ASSIGNMENT);
                    Field<?> field = getInto().field(0);
                    update.put(field, field);

                    toSQLInsert(ctx);
                    ctx.formatSeparator()
                       .start(INSERT_ON_DUPLICATE_KEY_UPDATE)
                       .keyword("on duplicate key update")
                       .sql(" ")
                       .visit(update)
                       .end(INSERT_ON_DUPLICATE_KEY_UPDATE);

                    break;
                }

                // Some dialects can't really handle this clause. Emulation should be done in two steps
                case H2: {
                    throw new SQLDialectNotSupportedException("The ON DUPLICATE KEY IGNORE clause cannot be emulated for " + ctx.configuration().dialect());
                }

                // Some databases allow for emulating this clause using a MERGE statement
                /* [pro] xx
                xxxx xxxx
                xxxx xxxxxxxxx
                xxxx xxxxxxx
                xxxx xxxxxxxxxx
                xxxx xxxxxxx
                xx [/pro] */
                case HSQLDB: {
                    ctx.visit(toMerge(ctx.configuration()));
                    break;
                }

                default:
                    throw new SQLDialectNotSupportedException("The ON DUPLICATE KEY IGNORE clause cannot be emulated for " + ctx.configuration().dialect());
            }
        }

        // Default mode
        // ------------
View Full Code Here

                    break;
                case H2:
                    stmt.setObject(nextIndex(), value);
                    break;
                default:
                    throw new SQLDialectNotSupportedException("Cannot bind ARRAY types in dialect " + dialect);
            }
        }
        else if (ArrayRecord.class.isAssignableFrom(type)) {
            stmt.setArray(nextIndex(), ((ArrayRecord<?>) value).createArray());
        }
View Full Code Here

                if ("nextval".equals(method)) {
                    String field = "next value for " + getQualifiedName(configuration);
                    return field(field, getDataType());
                }
                else {
                    throw new SQLDialectNotSupportedException("The sequence's current value functionality is not supported for the " + configuration.getDialect() + " dialect.");
                }
            }

            case CUBRID: {
                String field = getQualifiedName(configuration) + ".";
View Full Code Here

            case H2:
            case HSQLDB:
                return field("{datediff}('ms', {0}, {1})", getDataType(), timestamp2, timestamp1);

            case INGRES:
                throw new SQLDialectNotSupportedException("Date time arithmetic not supported in Ingres. Contributions welcome!");

            // MySQL's datetime operations operate on a microsecond level
            case MYSQL:
                return field("{timestampdiff}(microsecond, {0}, {1}) / 1000", getDataType(), timestamp2, timestamp1);
View Full Code Here

                    case MINUTE:
                        return field("{strftime}('%M', {0})", SQLDataType.INTEGER, field);
                    case SECOND:
                        return field("{strftime}('%S', {0})", SQLDataType.INTEGER, field);
                    default:
                        throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
                }

            case DERBY:
            case DB2:
                switch (datePart) {
                    case YEAR:
                        return function("year", SQLDataType.INTEGER, field);
                    case MONTH:
                        return function("month", SQLDataType.INTEGER, field);
                    case DAY:
                        return function("day", SQLDataType.INTEGER, field);
                    case HOUR:
                        return function("hour", SQLDataType.INTEGER, field);
                    case MINUTE:
                        return function("minute", SQLDataType.INTEGER, field);
                    case SECOND:
                        return function("second", SQLDataType.INTEGER, field);
                    default:
                        throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
                }

            case ORACLE:
                switch (datePart) {
                    case YEAR:
                        return field("{to_char}({0}, 'YYYY')", SQLDataType.INTEGER, field);
                    case MONTH:
                        return field("{to_char}({0}, 'MM')", SQLDataType.INTEGER, field);
                    case DAY:
                        return field("{to_char}({0}, 'DD')", SQLDataType.INTEGER, field);
                    case HOUR:
                        return field("{to_char}({0}, 'HH24')", SQLDataType.INTEGER, field);
                    case MINUTE:
                        return field("{to_char}({0}, 'MI')", SQLDataType.INTEGER, field);
                    case SECOND:
                        return field("{to_char}({0}, 'SS')", SQLDataType.INTEGER, field);
                    default:
                        throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
                }

            case ASE:
            case SQLSERVER:
            case SYBASE:
                switch (datePart) {
                    case YEAR:
                        return field("{datepart}(yy, {0})", SQLDataType.INTEGER, field);
                    case MONTH:
                        return field("{datepart}(mm, {0})", SQLDataType.INTEGER, field);
                    case DAY:
                        return field("{datepart}(dd, {0})", SQLDataType.INTEGER, field);
                    case HOUR:
                        return field("{datepart}(hh, {0})", SQLDataType.INTEGER, field);
                    case MINUTE:
                        return field("{datepart}(mi, {0})", SQLDataType.INTEGER, field);
                    case SECOND:
                        return field("{datepart}(ss, {0})", SQLDataType.INTEGER, field);
                    default:
                        throw new SQLDialectNotSupportedException("DatePart not supported: " + datePart);
                }

            case INGRES:
            case MYSQL:
            case POSTGRES:
View Full Code Here

                    return t.replace(" ARRAY", "");
                }
            }
        }

        throw new SQLDialectNotSupportedException("getArrayBaseType() is not supported for dialect " + dialect);
    }
View Full Code Here

                        return field("{dateadd}('ms', {0}, {1})", getDataType(), val(sign * (long) rhsAsDTS().getTotalMilli()), lhs);
                    }
                }

                case INGRES: {
                    throw new SQLDialectNotSupportedException("Date time arithmetic not supported in Ingres. Contributions welcome!");
                }

                case SQLITE: {
                    String prefix = (sign > 0) ? "+" : "-";

View Full Code Here

TOP

Related Classes of org.jooq.exception.SQLDialectNotSupportedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.