|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.pdatalog.PDatalogSQLFormatter
An formatter for pDatalog++ into SQL statements.
| Field Summary | |
protected SQLFormatter |
formatter
The formatter to be used. |
| Constructor Summary | |
PDatalogSQLFormatter(DB db)
Creates a new formatter. |
|
| Method Summary | |
void |
addIndex(java.lang.String tableName,
java.lang.String indexName,
java.lang.String[] cols,
boolean[] textCols)
Adds an index to the specified table. |
void |
clear(Relation relation)
Clear the specified relation, which means deletes all facts for that relation. |
void |
clear(java.lang.String tableName)
Clear the specified tables, which means deletes all rows. |
void |
close(java.sql.ResultSet rs)
Closes the specified ResultSet. |
void |
create(int arity,
java.lang.String relationName)
Creates a relation table. |
void |
create(Relation relation)
Creates a relation table. |
void |
create(java.lang.String tableName,
java.lang.String[] cols,
java.lang.String[] types)
Creates a table. |
void |
dump(int arity,
java.lang.String relationName)
Dumps the content of the specified relation to STDOUT. |
void |
dump(int arity,
java.lang.String relationName,
java.io.PrintStream out)
Dumps the content of the specified relation to the specified stream. |
void |
dump(Relation relation)
Dumps the content of the specified relation to STDOUT. |
void |
dump(Relation relation,
java.io.PrintStream out)
Dumps the content of the specified relation to the specified stream. |
boolean |
equals(java.lang.Object obj)
|
DB |
getDB()
Returns the underlying DB object. |
java.lang.String |
getSelect(SQL sql)
Returns a concrete select statement for this DB, obtained from the specified abstract SQL select statement. |
int |
hashCode()
|
void |
perform(SQL sql,
java.lang.String resultTableName)
Transforms the specified abstract SQL insert statement into a concrete SQL statement for this DB, and performs it. |
java.sql.ResultSet |
performQuery(SQL sql)
Transforms the specified abstract SQL select statement into a concrete SQL statement for this DB, performs it, and returns a corresponding ResultSet. |
void |
remove(java.lang.String tableName)
Removes the specified table. |
void |
setDB(DB db)
Sets the specified DB object. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected SQLFormatter formatter
| Constructor Detail |
public PDatalogSQLFormatter(DB db)
db - DB parameters| Method Detail |
public void create(Relation relation)
relation - relation for which a table will be created
public void create(int arity,
java.lang.String relationName)
arity - arity of the relation (number of arguments)relationName - name of the relationpublic void clear(Relation relation)
relation - relation to be clearedpublic void dump(Relation relation)
relation - relation to be dumped
public void dump(int arity,
java.lang.String relationName)
arity - arity of the relation to be dumpedrelationName - name of the relation to be dumped
public void dump(Relation relation,
java.io.PrintStream out)
relation - relation to be dumpedout - stream to which the relation will be dumped
public void dump(int arity,
java.lang.String relationName,
java.io.PrintStream out)
arity - arity of the relation to be dumpedrelationName - name of the relation to be dumpedout - stream to which the relation will be dumpedpublic void clear(java.lang.String tableName)
SQLFormatter
clear in interface SQLFormattertableName - name of the tablepublic void close(java.sql.ResultSet rs)
SQLFormatterResultSet.
close in interface SQLFormatterrs - result set
public void create(java.lang.String tableName,
java.lang.String[] cols,
java.lang.String[] types)
SQLFormatter
create in interface SQLFormattertableName - name of the tablecols - names of the columnstypes - types of the columns, can be subject to substitutionpublic boolean equals(java.lang.Object obj)
public DB getDB()
getDB in interface SQLFormatterpublic java.lang.String getSelect(SQL sql)
SQLFormatter
getSelect in interface SQLFormattersql - abstract SQL statement
public int hashCode()
public void perform(SQL sql,
java.lang.String resultTableName)
SQLFormatter
perform in interface SQLFormattersql - abstract SQL statementresultTableName - name of the result table (if null,
the insert name from the SQL statement will
be used)
public java.sql.ResultSet performQuery(SQL sql)
throws java.sql.SQLException
SQLFormatterResultSet.
performQuery in interface SQLFormattersql - abstract SQL statement
java.sql.SQLExceptionpublic void remove(java.lang.String tableName)
SQLFormatter
remove in interface SQLFormattertableName - name of the table to remove
public void addIndex(java.lang.String tableName,
java.lang.String indexName,
java.lang.String[] cols,
boolean[] textCols)
addIndex in interface SQLFormattertableName - name of the tableindexName - name of the new indexcols - imvolved columnstextCols - flag indicating that the column is a text columnpublic void setDB(DB db)
setDB in interface SQLFormatterdb - DB objectpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||