|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.orm.SqlDialect
public abstract class SqlDialect
SQL dialect abstract class. Methods of this class print a SQL statement(s) along a metamodel usually. You may create a subclass of any implementation to create another SQL statement, however just I can't exclude some small changes of this API in the next release.
| Field Summary | |
|---|---|
static java.lang.String |
COMMON_SEQ_TABLE_KEY
The table key for a common sequence emulator. |
static java.lang.String |
COMMON_SEQ_TABLE_NAME
The table key for a common sequence emulator. |
protected OrmHandler |
ormHandler
The ORM handler |
| Constructor Summary | |
|---|---|
SqlDialect()
|
|
| Method Summary | |
|---|---|
java.sql.Connection |
createConnection(MetaDatabase db)
Create a new database connection |
java.lang.String |
getCriterionTemplate(ValueCriterion crit)
Returns an SQL criterion template. |
abstract java.lang.String |
getJdbcDriver()
Returns a JDBC Driver |
abstract java.lang.String |
getJdbcUrl()
Returns a default JDBC Driver |
java.lang.String |
getLongType()
Returns a DB TYPE for the type java.lang.Long |
protected boolean |
isUsable(java.lang.CharSequence text)
Returns true, if the argument text is not null and not empty. |
java.lang.Appendable |
printColumnAlias(MetaColumn column,
java.lang.Appendable out)
Print a full SQL column alias name by sample: TABLE_ALIAS.COLUMN |
java.lang.Appendable |
printColumnDeclaration(MetaColumn column,
java.lang.String aName,
java.lang.Appendable out)
Print a SQL to create column |
java.lang.Appendable |
printCommit(java.lang.Appendable out)
Print SQL 'COMMIT' |
java.lang.Appendable |
printCreateSchema(java.lang.String schema,
java.lang.Appendable out)
Print SQL 'CREATE SCHEMA' |
ValueCriterion |
printCriterion(ValueCriterion crit,
java.lang.Appendable out)
Print a conditon phrase by the criterion. |
java.lang.Appendable |
printDefaultSchema(java.lang.String schema,
java.lang.Appendable out)
Deprecated. |
java.lang.Appendable |
printDelete(MetaTable table,
CriterionDecoder decoder,
java.lang.Appendable out)
Print an SQL DELETE statement. |
java.lang.Appendable |
printFKColumnsDeclaration(MetaColumn column,
java.lang.Appendable out)
Print a SQL to create foreign keys. |
java.lang.Appendable |
printForeignKey(MetaColumn column,
MetaTable table,
java.lang.Appendable out)
Print foreign key for the parameter column |
java.lang.Appendable |
printForeignKey(MetaTable table,
java.lang.Appendable out)
Print foreign key |
void |
printForeignKey(ValueCriterion crit,
MetaColumn column,
java.lang.String template,
java.lang.Appendable out)
Print all items of the foreign key |
java.lang.Appendable |
printFullTableName(MetaTable table,
java.lang.Appendable out)
Print a full SQL table name by sample: SCHEMA.TABLE |
java.lang.Appendable |
printInsert(OrmUjo bo,
java.lang.Appendable out)
Print an SQL INSERT statement. |
void |
println(java.lang.Appendable out)
Print the new line. |
java.lang.Appendable |
printSelect(MetaTable table,
Query query,
boolean count,
java.lang.Appendable out)
Print a SQL SELECT by table model and query |
void |
printSelectOrder(Query query,
java.lang.Appendable out)
Print SQL ORDER BY |
protected java.lang.Appendable |
printSelectTable(Query query,
boolean count,
java.lang.Appendable out)
Print SQL database SELECT |
protected java.lang.Appendable |
printSelectView(MetaTable table,
Query query,
boolean count,
java.lang.Appendable out)
Print SQL view SELECT |
java.lang.Appendable |
printSequenceCurrentValue(UjoSequencer sequence,
java.lang.Appendable out)
Print SQL CURRENT SEQUENCE VALUE. |
java.lang.Appendable |
printSequenceInit(UjoSequencer sequence,
java.lang.Appendable out)
Print SQL CREATE SEQUENCE (insert sequence row). |
protected java.lang.Appendable |
printSequenceName(UjoSequencer sequence,
java.lang.Appendable out)
Prinnt the full sequence name |
java.lang.Appendable |
printSequenceNextValue(UjoSequencer sequence,
java.lang.Appendable out)
Print SQL UPDATE NEXT SEQUENCE value. |
java.lang.Appendable |
printSequenceTable(MetaDatabase db,
java.lang.Appendable out)
Print SQL CREATE SEQUENCE. |
protected java.lang.Appendable |
printSequenceTableName(UjoSequencer sequence,
java.lang.Appendable out)
Prinnt the full sequence table |
java.lang.Appendable |
printTable(MetaTable table,
java.lang.Appendable out)
Print a SQL sript to create table |
void |
printTableAliasDefinition(MetaTable table,
java.lang.Appendable out)
Print a SQL database and table name and an alias definition - by sample: SCHEMA.TABLE ALIAS |
void |
printTableColumns(java.util.List<MetaColumn> columns,
java.lang.Appendable values,
java.lang.Appendable out)
Print table columns |
java.lang.Appendable |
printUpdate(MetaTable table,
java.util.List<MetaColumn> changedColumns,
CriterionDecoder decoder,
java.lang.Appendable out)
Print an SQL UPDATE statement. |
void |
setHandler(OrmHandler ormHandler)
Set the OrmHandler - the method is for internal call only. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COMMON_SEQ_TABLE_NAME
public static final java.lang.String COMMON_SEQ_TABLE_KEY
protected OrmHandler ormHandler
| Constructor Detail |
|---|
public SqlDialect()
| Method Detail |
|---|
public void setHandler(OrmHandler ormHandler)
public abstract java.lang.String getJdbcUrl()
public abstract java.lang.String getJdbcDriver()
public java.sql.Connection createConnection(MetaDatabase db)
throws java.lang.Exception
java.lang.Exception
public java.lang.Appendable printCreateSchema(java.lang.String schema,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
@Deprecated
public java.lang.Appendable printDefaultSchema(java.lang.String schema,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printFullTableName(MetaTable table,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public void printTableAliasDefinition(MetaTable table,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printColumnAlias(MetaColumn column,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printTable(MetaTable table,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printForeignKey(MetaTable table,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printForeignKey(MetaColumn column,
MetaTable table,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printColumnDeclaration(MetaColumn column,
java.lang.String aName,
java.lang.Appendable out)
throws java.io.IOException
column - Database ColumnaName - The name parameter is not mandatory, in case a null value the column name is used.
java.io.IOException
public java.lang.Appendable printFKColumnsDeclaration(MetaColumn column,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printInsert(OrmUjo bo,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printUpdate(MetaTable table,
java.util.List<MetaColumn> changedColumns,
CriterionDecoder decoder,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printDelete(MetaTable table,
CriterionDecoder decoder,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getCriterionTemplate(ValueCriterion crit)
public void printTableColumns(java.util.List<MetaColumn> columns,
java.lang.Appendable values,
java.lang.Appendable out)
throws java.io.IOException
columns - List of tablel columnsvalues - Print columns include alias.out - Table columns output.
java.io.IOException
public ValueCriterion printCriterion(ValueCriterion crit,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public void printForeignKey(ValueCriterion crit,
MetaColumn column,
java.lang.String template,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printSelect(MetaTable table,
Query query,
boolean count,
java.lang.Appendable out)
throws java.io.IOException
query - The UJO querycount - only count of items is required;
java.io.IOException
protected java.lang.Appendable printSelectView(MetaTable table,
Query query,
boolean count,
java.lang.Appendable out)
throws java.io.IOException
query - The UJO querycount - only count of items is required;
java.io.IOException
protected java.lang.Appendable printSelectTable(Query query,
boolean count,
java.lang.Appendable out)
throws java.io.IOException
query - The UJO querycount - only count of items is required;
java.io.IOException
public void printSelectOrder(Query query,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
protected java.lang.Appendable printSequenceName(UjoSequencer sequence,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
protected java.lang.Appendable printSequenceTableName(UjoSequencer sequence,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getLongType()
public java.lang.Appendable printSequenceTable(MetaDatabase db,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printSequenceInit(UjoSequencer sequence,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printSequenceNextValue(UjoSequencer sequence,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printSequenceCurrentValue(UjoSequencer sequence,
java.lang.Appendable out)
throws java.io.IOException
java.io.IOExceptionprotected boolean isUsable(java.lang.CharSequence text)
public final void println(java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
public java.lang.Appendable printCommit(java.lang.Appendable out)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||