- Type Parameters:
P- the type of SQL parameters used in this SQL statement
- All Known Implementing Classes:
AbstractSql,CallableSql,EmptySql,PreparedSql,ScriptCommand.ScriptSql
public interface Sql<P extends SqlParameter>
Represents an executable SQL statement with its parameters and metadata.
This interface provides access to both the raw SQL string with placeholders and the formatted SQL with actual parameter values for logging purposes.
The implementation class is not required to be thread safe.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the formatted SQL string.getKind()Returns the kind of the SQL.Returns the parameter list.Returns the raw SQL string.Returns the file path that contains this SQL.Returns the type of the SQL log.
-
Method Details
-
getKind
SqlKind getKind()Returns the kind of the SQL.- Returns:
- the kind of the SQL
-
getRawSql
String getRawSql()Returns the raw SQL string.The bind variables are displayed as
?.- Returns:
- the raw SQL string
-
getFormattedSql
String getFormattedSql()Returns the formatted SQL string.The bind variables are replaced with the string representations of the parameters.
- Returns:
- the formatted SQL string
-
getSqlFilePath
String getSqlFilePath()Returns the file path that contains this SQL.- Returns:
- the file path that contains this SQL、or
nullif this SQL is auto-generated
-
getParameters
Returns the parameter list.- Returns:
- the parameter list
-
getSqlLogType
SqlLogType getSqlLogType()Returns the type of the SQL log.- Returns:
- the type of the SQL log
-