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()
StatementConfiguration
Statement 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 StatementConfiguration
StatementConfiguration.baseClass()
public Class<?> baseClass()
StatementConfiguration
Base 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 StatementConfiguration
StatementConfiguration.statementName()
public Map<String,Object> generateParameterMap()
StatementConfiguration
Map 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 StatementConfiguration
StatementConfiguration.generateParametersAcceptingNull()
public Set<String> generateParametersAcceptingNull()
StatementConfiguration
This is useful mainly in Insert statements, rarely otherwise.
generateParametersAcceptingNull
in interface StatementConfiguration
StatementConfiguration.generateParameterMap()
public Long limit()
StatementConfiguration
limit
in interface StatementConfiguration
public void limit(Long limit)
StatementConfiguration
limit
in interface StatementConfiguration
limit
- limitpublic Long offset()
StatementConfiguration
offset
in interface StatementConfiguration
public void offset(Long offset)
StatementConfiguration
offset
in interface StatementConfiguration
offset
- offsetCopyright © 2014–2015 Vracon s.r.o.. All rights reserved.