public class DefaultDialect extends Object implements Dialect
Modifier and Type | Field and Description |
---|---|
protected static Pattern |
GROUP_BY_PATTERN |
protected static Pattern |
ORDER_BY_PATTERN |
Constructor and Description |
---|
DefaultDialect() |
Modifier and Type | Method and Description |
---|---|
protected void |
appendDate(StringBuilder query,
Date value) |
protected void |
appendEmptyRow(MetaModel metaModel,
StringBuilder query) |
protected void |
appendOrderBy(StringBuilder query,
List<String> orderBys) |
protected void |
appendQuestions(StringBuilder query,
int count) |
protected void |
appendSelect(StringBuilder queryBuilder,
String tableName,
String[] columns,
String tableAlias,
String subQuery,
List<String> orderBys) |
protected void |
appendSubQuery(StringBuilder queryBuilder,
String subQuery) |
protected void |
appendTime(StringBuilder query,
Time value) |
protected void |
appendTimestamp(StringBuilder query,
Timestamp value) |
protected void |
appendValue(StringBuilder query,
Object value,
String... replacements) |
String |
deleteManyToManyAssociation(Many2ManyAssociation association) |
String |
formSelect(String tableName,
String[] columns,
String subQuery,
List<String> orderBys,
long limit,
long offset) |
String |
insert(MetaModel metaModel,
Map<String,Object> attributes,
String... replacements) |
String |
insertManyToManyAssociation(Many2ManyAssociation association) |
String |
insertParametrized(MetaModel metaModel,
List<String> columns,
boolean containsId) |
Object |
overrideDriverTypeConversion(MetaModel mm,
String attributeName,
Object value) |
protected String |
replace(Object valueObject,
String... replacements) |
String |
selectCount(String from) |
String |
selectCount(String table,
String where) |
String |
selectExists(MetaModel metaModel) |
String |
selectManyToManyAssociation(Many2ManyAssociation association,
String sourceFkColumnName,
int questionsCount) |
String |
selectStar(String table) |
String |
selectStar(String table,
String where) |
String |
selectStarParametrized(String table,
String... parameters)
Produces a parametrized AND query.
|
String |
update(MetaModel metaModel,
Map<String,Object> attributes,
String... replacements) |
protected static final Pattern ORDER_BY_PATTERN
protected static final Pattern GROUP_BY_PATTERN
public String selectStar(String table)
selectStar
in interface Dialect
public String selectStar(String table, String where)
selectStar
in interface Dialect
public String selectStarParametrized(String table, String... parameters)
String sql = dialect.selectStarParametrized("people", "name", "ssn", "dob"); //generates: //SELECT * FROM people WHERE name = ? AND ssn = ? AND dob = ?
selectStarParametrized
in interface Dialect
table
- name of tableparameters
- list of parameter namesprotected void appendEmptyRow(MetaModel metaModel, StringBuilder query)
protected void appendQuestions(StringBuilder query, int count)
protected void appendOrderBy(StringBuilder query, List<String> orderBys)
protected void appendSubQuery(StringBuilder queryBuilder, String subQuery)
protected void appendSelect(StringBuilder queryBuilder, String tableName, String[] columns, String tableAlias, String subQuery, List<String> orderBys)
public String formSelect(String tableName, String[] columns, String subQuery, List<String> orderBys, long limit, long offset)
formSelect
in interface Dialect
public Object overrideDriverTypeConversion(MetaModel mm, String attributeName, Object value)
overrideDriverTypeConversion
in interface Dialect
public String selectCount(String from)
selectCount
in interface Dialect
public String selectCount(String table, String where)
selectCount
in interface Dialect
public String selectExists(MetaModel metaModel)
selectExists
in interface Dialect
public String selectManyToManyAssociation(Many2ManyAssociation association, String sourceFkColumnName, int questionsCount)
selectManyToManyAssociation
in interface Dialect
public String insertManyToManyAssociation(Many2ManyAssociation association)
insertManyToManyAssociation
in interface Dialect
public String insertParametrized(MetaModel metaModel, List<String> columns, boolean containsId)
insertParametrized
in interface Dialect
public String deleteManyToManyAssociation(Many2ManyAssociation association)
deleteManyToManyAssociation
in interface Dialect
protected void appendValue(StringBuilder query, Object value, String... replacements)
protected void appendDate(StringBuilder query, Date value)
protected void appendTime(StringBuilder query, Time value)
protected void appendTimestamp(StringBuilder query, Timestamp value)
public String insert(MetaModel metaModel, Map<String,Object> attributes, String... replacements)
Copyright © 2020 JavaLite. All rights reserved.