java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.AbstractSelectQuery
org.seasar.doma.jdbc.query.SqlFileSelectQuery
- All Implemented Interfaces:
Query,SelectQuery
A query that selects data from a database using an external SQL file.
This class extends AbstractSelectQuery to provide functionality for executing SELECT
statements defined in external SQL files. It handles SQL file loading, transformation, and
execution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SqlFileThe SQL file containing the SELECT statement.protected StringThe path to the SQL file.Fields inherited from class org.seasar.doma.jdbc.query.AbstractSelectQuery
aggregateStrategyType, entityType, fetchSize, fetchType, maxRows, options, parameters, resultEnsured, resultMappingEnsured, resultStream, sql, sqlLogTypeFields inherited from class org.seasar.doma.jdbc.query.AbstractQuery
callerClassName, callerMethodName, config, message, method, queryTimeout -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcomplete()Completes this query after execution.voidprepare()Prepares this query for execution.protected voidPrepares the SQL for this query.voidsetSqlFilePath(String sqlFilePath) Sets the path to the SQL file.Methods inherited from class org.seasar.doma.jdbc.query.AbstractSelectQuery
addParameter, addParameters, buildSql, clearParameters, createExpressionEvaluator, executeCount, expandAggregateColumns, expandColumns, getFetchSize, getFetchType, getMaxRows, getOptions, getSql, getSqlLogType, isResultEnsured, isResultMappingEnsured, isResultStream, populateValues, prepareOptions, setAggregateStrategyType, setEntityType, setFetchSize, setFetchType, setMaxRows, setOptions, setResultEnsured, setResultMappingEnsured, setResultStream, setSqlLogType, toStringMethods inherited from class org.seasar.doma.jdbc.query.AbstractQuery
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout, setCallerClassName, setCallerMethodName, setConfig, setMessage, setMethod, setQueryTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.seasar.doma.jdbc.query.Query
comment, getClassName, getConfig, getMethod, getMethodName, getQueryTimeout
-
Field Details
-
sqlFilePath
The path to the SQL file. -
sqlFile
The SQL file containing the SELECT statement.
-
-
Constructor Details
-
SqlFileSelectQuery
public SqlFileSelectQuery()
-
-
Method Details
-
prepare
public void prepare()Prepares this query for execution. This method must be called before the query is executed.This implementation prepares options and SQL.
- Specified by:
preparein interfaceQuery- Overrides:
preparein classAbstractSelectQuery
-
prepareSql
protected void prepareSql()Prepares the SQL for this query.This method loads the SQL file, transforms the SQL node using the dialect, and builds the prepared SQL statement.
- Specified by:
prepareSqlin classAbstractSelectQuery
-
complete
public void complete()Completes this query after execution. This method must be called after the query is executed. -
setSqlFilePath
Sets the path to the SQL file.- Parameters:
sqlFilePath- the SQL file path
-