Package org.apache.torque.sql
Klasse SqlBuilder
java.lang.Object
org.apache.torque.sql.SqlBuilder
Factored out code that is used to process SQL tables. This code comes
from BasePeer and is put here to reduce complexity in the BasePeer class.
You should not use the methods here directly!
- Version:
- $Id: SqlBuilder.java 1917245 2024-04-21 14:06:23Z tv $
- Autor:
- Henning P. Schmiedehausen, Thomas Fischer
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String[]
Delimiters for SQL functions.protected static final org.apache.logging.log4j.Logger
Logging -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic Query
buildQuery
(Criteria crit) Builds a Query from a criteria.static String
getFullTableName
(String table, String dbName) Fully qualify a table name with an optional schema reference.static TableMap
getTableMap
(String tableName, String dbName) Returns the table map for a table.static String
getUnqualifiedName
(String name, String dbName) Unqualify a table or column name.static List<WhereClausePsPartBuilder>
Returns the Builders which are responsible to render single where clause conditions.static String
guessFullTableFromCriteria
(Criteria criteria) Guesses a table name from a criteria by inspecting the first column in the criteria.
-
Felddetails
-
log
protected static final org.apache.logging.log4j.Logger logLogging -
FUNCTION_DELIMITERS
Delimiters for SQL functions.
-
-
Methodendetails
-
getWhereClausePsPartBuilders
Returns the Builders which are responsible to render single where clause conditions. The returned list can be modified in order to change the rendered SQL.- Gibt zurück:
- the current WhereClausePsPartBuilders, not null.
-
buildQuery
Builds a Query from a criteria.- Parameter:
crit
- the criteria to build the query from, not null.- Gibt zurück:
- the corresponding query to the criteria.
- Löst aus:
TorqueException
- if an error occurs
-
getFullTableName
Fully qualify a table name with an optional schema reference.- Parameter:
table
- The table name to use. If null is passed in, null is returned.dbName
- The name of the database to which this tables belongs. If null is passed, the default database is used.- Gibt zurück:
- The table name to use inside the SQL statement. If null is passed into this method, null is returned.
- Löst aus:
TorqueException
- if Torque is not yet initialized.
-
getUnqualifiedName
Unqualify a table or column name.- Parameter:
name
- the name to unqualify. If null is passed in, null is returned.dbName
- name of the database- Gibt zurück:
- The unqualified name.
- Löst aus:
TorqueException
- if the name cannot be determined.
-
guessFullTableFromCriteria
Guesses a table name from a criteria by inspecting the first column in the criteria.- Parameter:
criteria
- the criteria to guess the table name from.- Gibt zurück:
- the table name, not null.
- Löst aus:
TorqueException
- if the table name cannot be determined.
-
getTableMap
Returns the table map for a table.- Parameter:
tableName
- the name of the table.dbName
- the name of the database, null for the default db.- Gibt zurück:
- the table map for the table, not null.
- Löst aus:
TorqueException
- if the database or table is unknown.
-