Releases: EzFramework/JavaQueryBuilder
1.1.0
PostgreSQL dialect with ILIKE and RETURNING support
- Add
PostgreSqlDialectextendingAbstractSqlDialect:
double-quote identifier quoting,supportsReturning()=true,
appendConditionFragmentoverride for ILIKE/NOT ILIKE - Register
SqlDialect.POSTGRESQLconstant inSqlDialectinterface - Add ILIKE and NOT_ILIKE to Operator enum (PostgreSQL-only operators)
- Add
supportsReturning()hook toAbstractSqlDialect;
renderDelete()now appends RETURNING clause when the hook returns true
RETURNING clause support to DML builders
- Add
returningColumnsfield + getter/setter toQuery DeleteBuilder.returning(String... columns): passed throughQuery
toAbstractSqlDialect.renderDelete()viasupportsReturning()hookInsertBuilder.returning(String... columns): appended inline to SQLUpdateBuilder.returning(String... columns): appended inline to SQL
whereILike / orWhereILike builder methods
QueryBuilder.whereILike(column, value): ILIKE condition with AND connectorQueryBuilder.orWhereILike(column, value): ILIKE condition with OR connectorSelectBuilder.whereILike(column, value): ILIKE condition with AND connector
(follows existingwhereLikepattern; noorWhere* inSelectBuilder)
ColumnType for type-safe column definitions
- Add
ColumnTypefinal class with 25 fixed-type constants (TINYINTthrough
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
existingcolumn(String, String)viaColumnType.toSql(), fully backward
compatible - Add
ColumnTypeTest: 32 tests covering constants, factories, modifiers,
chaining, andCreateBuilderintegration
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/Boolnamed to avoid shadowingjava.langtypes
when the package is wildcard-importedColTypesTest: 34 tests covering all classes and modifier chaining
1.0.7
1.0.6
1.0.5
Github Pages Markdown Documentation
- Added Markdown documentation in
docs/folder- Added Github workflow to publish documentation to Github Pages
Integrate QueryBuilderDefaults into all SELECT/DELETE builders
QueryBuilder, DeleteBuilder, and SelectBuilder each gain:
- A
queryBuilderDefaultsfield initialised fromQueryBuilderDefaults.global()
at construction time (snapshot semantics, not live). - A
withDefaults(QueryBuilderDefaults)fluent method for per-instance
override without touching the global.
Behavioural changes when a non-default QueryBuilderDefaults is active:
- Dialect:
buildSql()/build()null-fallback now routes to the
configured dialect instead of hardcodedSqlDialect.STANDARD. - Default columns: rendered when no explicit
select()columns are set. - Default limit / offset: applied when builder sentinel (-1) is present
and the defaults carry a non-negative value (explicit wins). - LIKE wrapping:
SelectBuilder.whereLike()now honourslikePrefix/
likeSuffix(previously had no wrapping at all, aligned with
AbstractSqlDialect behaviour).
1.0.4
Added
Subquery support (feature/subquery — PR #21)
- New
JoinClausemodel class representing a JOIN entry targeting either a plain table or a derived-table subquery (INNER / LEFT / RIGHT / CROSS). - New
ScalarSelectItemmodel class representing a(SELECT ...) AS aliasitem in the SELECT clause. Queryextended with four new fields:fromSubquery,fromAlias,joins,selectSubqueries.QueryBuildernew fluent methods:whereInSubquery(String column, Query subquery)—WHERE col IN (SELECT ...)whereEqualsSubquery(String column, Query subquery)—WHERE col = (SELECT ...)whereExistsSubquery(Query subquery)—WHERE EXISTS (SELECT ...)whereNotExistsSubquery(Query subquery)—WHERE NOT EXISTS (SELECT ...)fromSubquery(Query subquery, String alias)—FROM (SELECT ...) AS aliasjoinSubquery(Query subquery, String alias, String onCondition)—INNER JOIN (SELECT ...) AS alias ON ...selectSubquery(Query subquery, String alias)— appends(SELECT ...) AS aliasto the SELECT list
DeleteBuildernew fluent methods:whereInSubquery(String column, Query subquery)—DELETE WHERE col IN (SELECT ...)whereExistsSubquery(Query subquery)—DELETE WHERE EXISTS (SELECT ...)
Operatorenum: addedEXISTS_SUBQUERYandNOT_EXISTS_SUBQUERYvalues.- Deterministic subquery parameter ordering contract in
AbstractSqlDialect.render(): scalar SELECT subquery params → FROM subquery params → JOIN subquery params → WHERE condition params. - New test classes:
SubqueryConditionTest,ExistsSubqueryTest,FromSubqueryTest,JoinSubqueryTest,ScalarSelectSubqueryTest,NestedSubqueryParamOrderTest,DeleteSubqueryIntegrationTest. SqlExecutionMatrixTest— real SQLite integration tests covering all builder operations across standard, MySQL, and SQLite dialects.- Test dependencies added:
junit-jupiter-params6.0.3,sqlite-jdbc3.46.1.3 (test scope).
Dialect-aware DELETE rendering (feature/delete-from — PR #20)
SqlDialectinterface: newrenderDelete(Query query)method.AbstractSqlDialect.renderDelete(Query)— standard implementation renderingDELETE FROM <table> WHERE ...with full parameter binding via the sharedappendWhereClausehelper.AbstractSqlDialect.supportsDeleteLimit()— protected hook; defaultfalse. Override to enable dialect-specificDELETE ... LIMIT.MySqlDialect: overridessupportsDeleteLimit()→true.SqliteDialect: overridessupportsDeleteLimit()→true.AbstractSqlDialectDeleteTest— new test class covering DELETE rendering, dialect quoting, LIMIT behaviour, and IN-clause placeholder count.
Changed
DeleteBuilder.build(SqlDialect)refactored: removed inline SQL string building; now delegates entirely toSqlDialect.renderDelete(Query).AbstractSqlDialect.appendWhereClause()andappendConditionFragment()promoted fromprivatetoprotectedto allow reuse inrenderDelete.Condition.matches()updated: guardsINandNOT_INoperators against subquery values (returnsfalsewhen value is aQueryinstance, since subqueries cannot be evaluated in-memory).- CI: replaced JaCoCo PR-comment reporter (
madrapps/jacoco-report) withcodecov/codecov-action@v5.
Documentation
- README updated with subquery usage examples (scalar SELECT, FROM derived table, JOIN subquery, WHERE IN subquery, WHERE EXISTS).
- README updated with
renderDeletedocumentation and DELETE LIMIT dialect behaviour. - README artifact ID corrected.
- Version bumped to
1.0.4inpom.xml.
1.0.3
Added
- SelectBuilder: fluent builder for SQL
SELECTstatements with support for
columns,WHEREconditions,ORDER BY,GROUP BY,HAVING,LIMIT,OFFSET, andDISTINCT - CreateBuilder: fluent builder for SQL
CREATE TABLEstatements with support for
columns, primary keys, andIF NOT EXISTS - QueryBuilder: unified static entry point for all builder types
select(),from()for SELECT queriesinsert(),insertInto(table)forINSERTqueriesupdate(),update(table)forUPDATEqueriesdelete(),deleteFrom(table)forDELETEqueriescreateTable(),createTable(table)forCREATE TABLEqueries
- Table-shortcut overloads on QueryBuilder:
insertInto,deleteFrom,update(table),
andcreateTable(table)to set the target table in a single call whereInsupport onDeleteBuilder
Fixed
- DeleteBuilder: restored missing
build()andbuild(SqlDialect)methods whose
Javadoc was malformed and consumed the method body - DeleteBuilder: added missing imports (Connector, Operator, SqlDialect, SqlResult, Map)
- DeleteBuilder: added appendDmlCondition helper to handle all comparison operators
and resolve cyclomatic complexity violation; fixed duplicate /** onhandleBetweenOperator - CreateBuilder: repaired malformed class-level Javadoc that contained an embedded
method body, and fixed unclosedbuild(SqlDialect)Javadoc comment - QueryBuilder: removed redundant same-package imports, fixed import ordering,
added complete Javadoc on all public API methods
1.0.2
- Fixed issue in Jitpack publish CI
1.0.1
Java 25
Updated the package to Java 25
1.0.0
Highlights
- Fluent, type-safe builder API for constructing SQL
SELECTqueries in Java - Parameterized SQL generation: All queries use
?placeholders and separate parameter lists, ensuring safety from SQL injection - Comprehensive operator support:
=,!=,>,<,LIKE,IN,BETWEEN,IS NOT NULL, and more - Column selection, grouping, sorting, and pagination: Easily specify columns,
GROUP BY,ORDER BY,LIMIT, andOFFSET - Multiple SQL dialects: Built-in support for Standard SQL and SQLite, with automatic identifier quoting and boolean handling
- In-memory filtering: Use the same query objects to filter Java collections via the
QueryableStorageinterface - No runtime dependencies: Pure Java 21 library
Example Usage
SqlResult result = new QueryBuilder()
.select("id", "name")
.whereEquals("status", "active")
.orderBy("name", true)
.limit(10)
.buildSql("users");Architecture
- Fluent builders for SELECT, INSERT, UPDATE, DELETE
- Immutable
Queryobjects - Pluggable SQL dialects
- Full Javadoc and Checkstyle compliance