public abstract class AbstractSqlTag extends Object implements SqlTag
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_BATCH |
static String |
ATTRIBUTE_CACHE |
static String |
ATTRIBUTE_GROUP_BY |
static String |
ATTRIBUTE_HINT |
static String |
ATTRIBUTE_ISOLATION |
static String |
ATTRIBUTE_NAME |
static String |
ATTRIBUTE_RESULTSET_CONCURRENCY |
static String |
ATTRIBUTE_RESULTSET_HOLDABILITY |
static String |
ATTRIBUTE_RESULTSET_TYPE |
static String |
ATTRIBUTE_RETURN_TYPE |
static String |
ATTRIBUTE_TIMEOUT |
static String |
ATTRIBUTE_TYPE |
static String |
ATTRIBUTE_VALIDATION |
protected String |
id |
protected LanguageType |
languageType |
protected static Assertable |
NOT_NULL |
Constructor and Description |
---|
AbstractSqlTag(String id,
LanguageType languageType)
Build a new SQL tag from XML file.
|
AbstractSqlTag(String id,
LanguageType languageType,
Isolation isolation,
int timeout,
ResultSetType resultSetType,
ResultSetConcurrency resultSetConcurrency,
ResultSetHoldability resultSetHoldability,
String returnType,
ValidateType validateType,
Statistical stats)
Build a new SQL tag from XML file.
|
AbstractSqlTag(String id,
LanguageType languageType,
Isolation isolation,
int timeout,
ValidateType validateType,
Statistical stats)
Build a new SQL tag from XML file.
|
AbstractSqlTag(String id,
LanguageType languageType,
SqlDialect sqlDialect) |
Modifier and Type | Method and Description |
---|---|
void |
addTag(ITextTag tag)
add a new text tag.
|
void |
addTag(List<ITextTag> tags)
add a set of text tags (static or dynamic).
|
void |
addTag(String text)
add a set of static text from tag elements.
|
Deletable |
asDeletable()
Deletable instance |
Insertable |
asInsertable()
Insertable instance |
Selectable |
asSelectable()
Selectable instance |
Storable |
asStorable()
Storable instance |
Updateable |
asUpdateable()
Updateable instance |
void |
bind(SqlDialect sqlDialect) |
boolean |
equals(Object obj) |
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()
language from SQL sentence.
|
String |
getName()
Retrieve the identifier name from tag.
|
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
|
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
|
int |
hashCode() |
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 |
setIsolation(Isolation isolation) |
void |
setPackage(String name)
name of package this sql belong
|
void |
setResourceName(String resourceName)
File name from Sql
|
void |
setResultSetConcurrency(ResultSetConcurrency resultSetConcurrency) |
void |
setResultSetHoldability(ResultSetHoldability resultSetHoldability) |
void |
setResultSetType(ResultSetType resultSetType) |
void |
setResultType(String returnType) |
protected void |
setStats(Statistical stats) |
void |
setTimeout(int timeout) |
void |
setValidateType(ValidateType validateType) |
void |
setXpath(String xpath)
set the XPATH expression to retrieve the query at xml file.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getTagName
getSqlType
protected static final Assertable NOT_NULL
public static final String ATTRIBUTE_NAME
public static final String ATTRIBUTE_TYPE
public static final String ATTRIBUTE_ISOLATION
public static final String ATTRIBUTE_TIMEOUT
public static final String ATTRIBUTE_HINT
public static final String ATTRIBUTE_BATCH
public static final String ATTRIBUTE_CACHE
public static final String ATTRIBUTE_RETURN_TYPE
public static final String ATTRIBUTE_GROUP_BY
public static final String ATTRIBUTE_RESULTSET_TYPE
public static final String ATTRIBUTE_RESULTSET_CONCURRENCY
public static final String ATTRIBUTE_RESULTSET_HOLDABILITY
public static final String ATTRIBUTE_VALIDATION
protected LanguageType languageType
public AbstractSqlTag(String id, LanguageType languageType)
id
- Name/Identify from tag.languageType
- type of language from tag.public AbstractSqlTag(String id, LanguageType languageType, SqlDialect sqlDialect)
public AbstractSqlTag(String id, LanguageType languageType, Isolation isolation, int timeout, ValidateType validateType, Statistical stats)
id
- Name/Identify from tag.languageType
- type of language from tag.isolation
- Retrieves the current transaction isolation level for the
query.timeout
- Retrieves the number of seconds the repository will wait for a
Query object to execute.validateType
- validation to apply before execute SQL.stats
- SQL statisticalpublic AbstractSqlTag(String id, LanguageType languageType, Isolation isolation, int timeout, ResultSetType resultSetType, ResultSetConcurrency resultSetConcurrency, ResultSetHoldability resultSetHoldability, String returnType, ValidateType validateType, Statistical stats)
id
- Name/Identify from tag.languageType
- type of language from tag.isolation
- Retrieves the current transaction isolation level for the
query.timeout
- Retrieves the number of seconds the repository will wait for a
Query object to execute.resultSetType
- TODO javadocresultSetConcurrency
- TODO javadocresultSetHoldability
- TODO javadocreturnType
- vvalidateType
- TODO javadocstats
- statistical for procedurespublic String getSql(Object params)
public LanguageType getLanguageType()
getLanguageType
in interface Sql
public Isolation getIsolation()
Sql
getIsolation
in interface Sql
public void setIsolation(Isolation isolation)
public int getTimeout()
Sql
getTimeout
in interface Sql
public void setTimeout(int timeout)
public boolean isSelectable()
Sql
isSelectable
in interface Sql
true
when is SELECT, false
otherwisepublic boolean isInsertable()
Sql
isInsertable
in interface Sql
true
when is INSERT, false
otherwisepublic boolean isUpdateable()
Sql
isUpdateable
in interface Sql
true
when is UPDATE, false
otherwisepublic boolean isDeletable()
Sql
isDeletable
in interface Sql
true
when is DELETE, false
otherwisepublic Selectable asSelectable()
Sql
Selectable
instanceasSelectable
in interface Sql
public Insertable asInsertable()
Sql
Insertable
instanceasInsertable
in interface Sql
public Updateable asUpdateable()
Sql
Updateable
instanceasUpdateable
in interface Sql
public Deletable asDeletable()
Sql
Deletable
instanceasDeletable
in interface Sql
public boolean isStorable()
Sql
isStorable
in interface Sql
true
when is STORED PROCEDURE, false
otherwisepublic Storable asStorable()
Sql
Storable
instanceasStorable
in interface Sql
public ResultSetType getResultSetType()
getResultSetType
in interface Sql
public void setResultSetType(ResultSetType resultSetType)
public ResultSetConcurrency getResultSetConcurrency()
getResultSetConcurrency
in interface Sql
public void setResultSetConcurrency(ResultSetConcurrency resultSetConcurrency)
public ResultSetHoldability getResultSetHoldability()
getResultSetHoldability
in interface Sql
public void setResultSetHoldability(ResultSetHoldability resultSetHoldability)
public void setResultType(String returnType)
public String getReturnType()
getReturnType
in interface Sql
public boolean hasReturnType()
hasReturnType
in interface Sql
public Class<?> getReturnTypeAsClass()
getReturnTypeAsClass
in interface Sql
public void setValidateType(ValidateType validateType)
setValidateType
in interface Sql
public ValidateType getValidateType()
getValidateType
in interface Sql
public void setXpath(String xpath)
SqlTag
public String getXPath()
Sql
public void setResourceName(String resourceName)
SqlTag
setResourceName
in interface SqlTag
resourceName
- filename from sql as resourcepublic String getResourceName()
Sql
getResourceName
in interface Sql
public Date getTimestamp()
Sql
getTimestamp
in interface Sql
public ParamParser getParamParser()
Sql
getParamParser
in interface Sql
public String[] extractNames(Object params)
Sql
extractNames
in interface Sql
params
- parameters from querypublic String[] extractNames(String sql)
Sql
extractNames
in interface Sql
sql
- sentencepublic void bind(SqlDialect sqlDialect)
public SqlDialect getSqlDialect()
Sql
getSqlDialect
in interface Sql
public String getPackage()
Sql
getPackage
in interface Sql
public void setPackage(String name)
SqlTag
setPackage
in interface SqlTag
name
- of packagepublic Statistical getStats()
Sql
protected void setStats(Statistical stats)
Copyright © 2012–2020 jkniv, copyleft code. All rights reserved.