Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:APIJSON APIJSON AbstractSQLConfig concatJoinWhereString

From Leeroopedia
Knowledge Sources
Domains ORM, SQL_Generation, SQL_Join
Last Updated 2026-10-11 00:00 GMT

Overview

Concrete SQL clause generator that combines the main table's WHERE clause with join table outer conditions, producing the complete WHERE string for SQL JOIN queries, provided by the APIJSON ORM framework.

Description

The concatJoinWhereString' method on AbstractSQLConfig merges the main table's WHERE conditions with each join's outer config conditions. For each join in the joinList:

  • CROSS JOIN (*) and APP JOIN (@): treated with AND logic
  • LEFT JOIN (<): main WHERE + outer WHERE with AND
  • RIGHT JOIN (>): main WHERE + outer WHERE with OR
  • INNER JOIN (&): main WHERE + outer WHERE with AND
  • FULL JOIN (|): main WHERE + outer WHERE with OR
  • OUTER JOIN (!): main WHERE + outer WHERE with NOT
  • SIDE JOIN (^): main WHERE + outer WHERE with OR
  • ANTI JOIN ((): main WHERE + outer WHERE with NOT

The method also merges prepared-statement value lists from the outer configs into the main prepared value list.

Usage

Called internally by getWhereString() after the main WHERE clause is generated. Not typically called directly.

Code Reference

Source Location

  • Repository: APIJSON
  • File: src/main/java/apijson/orm/AbstractSQLConfig.java

Signature

protected String concatJoinWhereString(String whereString) throws Exception

Parameters:

  • whereString - The main table's WHERE clause string (without WHERE prefix)

Returns: String - Combined WHERE clause with join conditions

Import

import apijson.orm.AbstractSQLConfig;

I/O Contract

Inputs

Name Type Required Description
whereString String Yes Main table WHERE clause
joinList List<Join> Yes Join configurations with outerConfig
isPrepared boolean Yes Whether using prepared statements

Outputs

Name Type Description
return String Combined WHERE clause with join conditions
preparedValueList List<Object> Updated with outer config prepared values

Usage Examples

LEFT JOIN WHERE Combination

// Main WHERE: "id > 0"
// Join: LEFT JOIN User with outer WHERE: "name LIKE 'Tom%'"
// Logic for LEFT JOIN: AND

// Result: "( ( id > 0 AND ( name LIKE 'Tom%' ) ) )"
// Full SQL: SELECT ... FROM Moment LEFT JOIN User ON ... WHERE ( ( id > 0 AND ( name LIKE 'Tom%' ) ) )

INNER JOIN WHERE Combination

// Main WHERE: "userId = 82001"
// Join: INNER JOIN Comment with outer WHERE: "content LIKE 'Hello%'"
// Logic for INNER JOIN: AND

// Result: "( ( userId = 82001 AND ( content LIKE 'Hello%' ) ) )"

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment