Skip to content

1.1.0

Latest

Choose a tag to compare

@ez-plugins ez-plugins released this 22 Apr 21:07
· 2 commits to main since this release
28ad3d5

PostgreSQL dialect with ILIKE and RETURNING support

  • Add PostgreSqlDialect extending AbstractSqlDialect:
    double-quote identifier quoting, supportsReturning()=true,
    appendConditionFragment override for ILIKE/NOT ILIKE
  • Register SqlDialect.POSTGRESQL constant in SqlDialect interface
  • Add ILIKE and NOT_ILIKE to Operator enum (PostgreSQL-only operators)
  • Add supportsReturning() hook to AbstractSqlDialect;
    renderDelete() now appends RETURNING clause when the hook returns true

RETURNING clause support to DML builders

  • Add returningColumns field + getter/setter to Query
  • DeleteBuilder.returning(String... columns): passed through Query
    to AbstractSqlDialect.renderDelete() via supportsReturning() hook
  • InsertBuilder.returning(String... columns): appended inline to SQL
  • UpdateBuilder.returning(String... columns): appended inline to SQL

whereILike / orWhereILike builder methods

  • QueryBuilder.whereILike(column, value): ILIKE condition with AND connector
  • QueryBuilder.orWhereILike(column, value): ILIKE condition with OR connector
  • SelectBuilder.whereILike(column, value): ILIKE condition with AND connector
    (follows existing whereLike pattern; no orWhere* in SelectBuilder)

ColumnType for type-safe column definitions

  • Add ColumnType final class with 25 fixed-type constants (TINYINT through
    UUID), 7 parameterised factory methods (varChar, charType, decimal,
    numeric, binary, varBinary, timestamp), and 4 chainable modifier methods
    (notNull, unique, autoIncrement, defaultValue)
  • Add CreateBuilder.column(String, ColumnType) overload; delegates to the
    existing column(String, String) via ColumnType.toSql(), fully backward
    compatible
  • Add ColumnTypeTest: 32 tests covering constants, factories, modifiers,
    chaining, and CreateBuilder integration

Per-type shorthand classes

Each class in the new col package wraps a single ColumnType constant or
factory method behind a concise name and a uniform of() / of(params)
factory. Developers can use a wildcard import to write:

import com.github.ezframework.javaquerybuilder.query.builder.col.*;

.column("id",         Int.of().notNull().autoIncrement())
.column("username",   VarChar.of(64).notNull().unique())
.column("price",      Decimal.of(10, 2))
.column("created_at", Timestamp.of())

instead of prefixing every type with ColumnType.

Classes added (31 total):
Fixed types: TinyInt, SmallInt, Int, BigInt, SqlFloat, SqlDouble,
Real, Bool, Text, TinyText, MediumText, LongText, Clob,
Blob, TinyBlob, MediumBlob, LongBlob, Date, Time, DateTime,
Json, Serial, BigSerial, Uuid
Parameterised types: Timestamp (overloaded of() / of(int)),
VarChar, Char, Decimal, Numeric, Binary, VarBinary

  • SqlFloat / SqlDouble / Bool named to avoid shadowing java.lang types
    when the package is wildcard-imported
  • ColTypesTest: 34 tests covering all classes and modifier chaining