public abstract class StatementConfigurationAdapter extends Object implements StatementConfiguration
StatementConfiguration.| Constructor and Description |
|---|
StatementConfigurationAdapter(String statementName,
Class<?> baseClass)
Creates instance of configuration with mandatory fields.
|
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
baseClass()
Returns base class.
|
Map<String,Object> |
generateParameterMap()
Map of parameters to construct statement in runtime.
|
Set<String> |
generateParametersAcceptingNull()
Returns parameters for which null doesn't mean to skip row.
|
Long |
limit()
Gets maximum number of rows to be loaded.
|
void |
limit(Long limit)
Sets maximum number of rows to be loaded.
|
Long |
offset()
Gets result set offset.
|
void |
offset(Long offset)
Sets result set offset.
|
String |
statementName()
Returns statement name.
|
public String statementName()
StatementConfigurationStatement name can be represented in two ways:
StatementConfiguration.baseClass() returns null - name must be full path to sql file including file extension.StatementConfiguration.baseClass() returns real class - name is just a part of path. Full name (and full path) is
concatenation of base classes' path this name and .sql extension.Statement name may not be null.
statementName in interface StatementConfigurationStatementConfiguration.baseClass()public Class<?> baseClass()
StatementConfigurationBase class has two functions:
Statements generated from java comments use as a base class the same class from which they were extracted.
baseClass in interface StatementConfigurationStatementConfiguration.statementName()public Map<String,Object> generateParameterMap()
StatementConfigurationMap contains parameters which can be used as each of three possibilities:
In runtime if parameter is used as a SQL parameter and has null value or is missing at all - it means to skip
statement row. Exception to this rule are parameters returned by StatementConfiguration.generateParametersAcceptingNull().
generateParameterMap in interface StatementConfigurationStatementConfiguration.generateParametersAcceptingNull()public Set<String> generateParametersAcceptingNull()
StatementConfigurationThis is useful mainly in Insert statements, rarely otherwise.
generateParametersAcceptingNull in interface StatementConfigurationStatementConfiguration.generateParameterMap()public Long limit()
StatementConfigurationlimit in interface StatementConfigurationpublic void limit(Long limit)
StatementConfigurationlimit in interface StatementConfigurationlimit - limitpublic Long offset()
StatementConfigurationoffset in interface StatementConfigurationpublic void offset(Long offset)
StatementConfigurationoffset in interface StatementConfigurationoffset - offsetCopyright © 2014–2015 Vracon s.r.o.. All rights reserved.