public interface Sql
Those queries can be dynamic or static and to recover a dynamic query (built on-the-fly) is necessary to pass the parameters that can be mounted dynamically.
Modifier and Type | Method and Description |
---|---|
Deletable |
asDeletable()
Deletable instance |
Insertable |
asInsertable()
Insertable instance |
Selectable |
asSelectable()
Selectable instance |
Storable |
asStorable()
Storable instance |
Updateable |
asUpdateable()
Updateable instance |
void |
bind(SqlDialect sqlDialect) |
String[] |
extractNames(Object params)
Extract the name parameters from dynamic query
|
String[] |
extractNames(String sql)
Extract the name parameters from SQL
|
Isolation |
getIsolation()
Retrieves the current transaction isolation level for the query.
|
LanguageType |
getLanguageType()
Retrieve the language type used at sql sentence.
|
String |
getName()
The name of query into XML file
|
String |
getPackage()
name of package that this SQL belongs
|
ParamParser |
getParamParser()
strategy to parser the parameters from SQL.
|
String |
getResourceName()
The filename that SQL belong to
|
ResultSetConcurrency |
getResultSetConcurrency() |
ResultSetHoldability |
getResultSetHoldability() |
ResultSetType |
getResultSetType() |
String |
getReturnType() |
Class<?> |
getReturnTypeAsClass() |
String |
getSql()
Retrieve static SQL from a node, the dynamic parts is skipped.
|
String |
getSql(Object params)
Retrieve dynamic SQL from a node, the dynamic parts is evaluated at time
to create the SQL.
|
SqlDialect |
getSqlDialect()
dialect for a specific database
|
SqlType |
getSqlType()
Retrieve node type: INSERT, UPDATE, DELETE, SELECT or PROCEDURE.
|
Statistical |
getStats()
get statistical data from query execution
|
int |
getTimeout()
Retrieves the number of seconds the repository will wait for a Query
object to execute.
|
Date |
getTimestamp()
Timestamp when sql was read from xml
|
ValidateType |
getValidateType() |
String |
getXPath()
Expression XPATH to read SQL
|
boolean |
hasReturnType() |
boolean |
isDeletable()
Verify if command is a DELETE
|
boolean |
isInsertable()
Verify if command is a INSERT
|
boolean |
isSelectable()
Verify if command is a SELECT
|
boolean |
isStorable()
Verify if command is a STORED PROCEDURE
|
boolean |
isUpdateable()
Verify if command is a UPDATE
|
void |
setValidateType(ValidateType validateType) |
String getSql()
String getSql(Object params)
params
- parameters to evaluate dynamic SQL, can be a object like
Author, Book, etc or a java.util.Map where yours keys is like
the properties.SqlType getSqlType()
boolean isSelectable()
true
when is SELECT, false
otherwiseSelectable asSelectable()
Selectable
instanceUnsupportedOperationException
- when this instance isn't Selectable
boolean isInsertable()
true
when is INSERT, false
otherwiseInsertable asInsertable()
Insertable
instanceUnsupportedOperationException
- when this instance isn't Insertable
boolean isUpdateable()
true
when is UPDATE, false
otherwiseUpdateable asUpdateable()
Updateable
instanceUnsupportedOperationException
- when this instance isn't Updateable
boolean isDeletable()
true
when is DELETE, false
otherwiseDeletable asDeletable()
Deletable
instanceUnsupportedOperationException
- when this instance isn't Deletable
boolean isStorable()
true
when is STORED PROCEDURE, false
otherwiseStorable asStorable()
Storable
instanceUnsupportedOperationException
- when this instance isn't Storable
LanguageType getLanguageType()
Isolation getIsolation()
int getTimeout()
ResultSetType getResultSetType()
ResultSetConcurrency getResultSetConcurrency()
ResultSetHoldability getResultSetHoldability()
String getReturnType()
boolean hasReturnType()
Class<?> getReturnTypeAsClass()
Date getTimestamp()
String getResourceName()
String getXPath()
ParamParser getParamParser()
String[] extractNames(Object params)
params
- parameters from queryString[] extractNames(String sql)
sql
- sentenceValidateType getValidateType()
void setValidateType(ValidateType validateType)
void bind(SqlDialect sqlDialect)
SqlDialect getSqlDialect()
String getPackage()
Statistical getStats()
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.