|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.codegen.java.model.util.SQLProvider
public final class SQLProvider
This class produces different SQL statement strings based on
the database model DataBaseTable
| Constructor Summary | |
|---|---|
SQLProvider(DataBaseTable _model)
Initialize the model |
|
SQLProvider(DataBaseTable _model,
boolean exteranlValue)
Initialize the model |
|
| Method Summary | |
|---|---|
java.lang.String |
getInsertSQL(java.util.List<Pair> values)
Generate the insert SQL for the listed values |
java.lang.String |
getSelectAllSQL()
Generate the insert SQL to select all records of a table |
java.lang.String |
getSelectByIndex(java.util.List<Pair> values,
java.lang.String indexName)
Generate the select SQL by the index of the given name. |
java.lang.String |
getSelectByIndex(java.util.List<Pair> values,
java.lang.String indexName,
java.util.List<java.lang.String> select)
Generate the select SQL with only specified fields by the index of the given name. |
java.lang.String |
getSelectUnique(java.util.List<Pair> values)
Generate the select SQL by the unique index which's name starts with 'PK_'. |
java.lang.String |
getSelectUnique(java.util.List<Pair> values,
java.util.List<java.lang.String> select)
Generate the select SQL with only specified fields by the unique index which's name starts with 'PK_'. |
java.lang.String |
getUpdateAllSQL(java.util.List<Pair> values)
Generates an update SQL for all records in the database |
java.lang.String |
getUpdateSQL(java.util.List<Pair> values)
Generate an update SQL for all fields of the model that are not contained in the unique index that name does not start with 'PK_'. |
java.lang.String |
getUpdateSQL(java.util.List<Pair> values,
java.lang.String indexName)
Generate an update SQL for all fields of the model that are not contained in the indicated index. |
java.lang.String |
getWhereClause(DataBaseTableIndex index,
java.util.List<Pair> values)
Create the partial String of the where clause based on the index and the provided values |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLProvider(DataBaseTable _model)
_model - of the table
public SQLProvider(DataBaseTable _model,
boolean exteranlValue)
_model - of the tableexteranlValue - Flag indicating if the values are values or method calls| Method Detail |
|---|
public java.lang.String getUpdateSQL(java.util.List<Pair> values)
getUpdateSQL(List)
values - List of key value pairs that correspondent with the database
fields that are to be updated
public java.lang.String getUpdateSQL(java.util.List<Pair> values,
java.lang.String indexName)
values - List of key value pairs that correspondent with the database
fields that are to be updatedindexName - name of the index
public java.lang.String getUpdateAllSQL(java.util.List<Pair> values)
values - List of key value pairs that correspondent with the database
fields that are to be updated
public java.lang.String getInsertSQL(java.util.List<Pair> values)
values - List of key value pairs that correspondent with the database
fields that are to be inserted
public java.lang.String getSelectAllSQL()
public java.lang.String getSelectUnique(java.util.List<Pair> values)
getSelectByIndex(List,String,List)
values - List of key value pairs that correspondent with the database
fields that are to be updated
public java.lang.String getSelectByIndex(java.util.List<Pair> values,
java.lang.String indexName)
values - List of key value pairs that correspondent with the database
fields that are to be updatedindexName - name of the index
public java.lang.String getSelectUnique(java.util.List<Pair> values,
java.util.List<java.lang.String> select)
getSelectByIndex(List,String,List)
values - List of key value pairs that correspondent with the database
fields that are to be updatedselect - List of the fields to show up in the select statement
public java.lang.String getSelectByIndex(java.util.List<Pair> values,
java.lang.String indexName,
java.util.List<java.lang.String> select)
values - List of key value pairs that correspondent with the database
fields that are to be updatedindexName - name of the indexselect - List of the fields to show up in the select statement
public java.lang.String getWhereClause(DataBaseTableIndex index,
java.util.List<Pair> values)
index - to be usedvalues - List with values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||