|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.hardcode.gdbms.engine.data.InnerDBUtils
public class InnerDBUtils
Utility class to generate SQL statements
Constructor Summary | |
---|---|
InnerDBUtils()
|
Method Summary | |
---|---|
static java.lang.String |
buildSQLWhere(java.lang.String[] pks,
java.lang.String[] fieldNames)
Builds a WHERE clause with the and operation of the equality between each field name and field value |
static java.lang.String |
createDeleteStatement(Value[] pks,
java.lang.String[] names,
java.lang.String tableName,
ValueWriter vWriter)
Creates a delete statement in the specified table in the row specified by the field names and field values |
static java.lang.String |
createInsertStatement(java.lang.String tableName,
Value[] row,
java.lang.String[] fieldNames,
ValueWriter vWriter)
Creates a new Insert statement in the specified table with the specified values for the corresponding field names |
static java.lang.String |
createUpdateStatement(java.lang.String tableName,
Value[] pk,
java.lang.String[] pkNames,
java.lang.String[] fieldNames,
Value[] values,
ValueWriter vWriter)
creates an update statement in the specified table |
static void |
execute(java.lang.String database,
java.lang.String sql)
DOCUMENT ME! |
static java.lang.String |
getCreateStatementWithAutonumeric(java.lang.String tableName,
java.lang.String[] names,
int[] types)
Creates a SQL statement to create a table. |
static java.lang.String |
getCreateStatementWithPK(java.lang.String tableName,
java.lang.String[] pkNames,
java.lang.String[] names,
int[] types)
Creates a SQL statement to create a table. |
static java.lang.String |
getPKIndexStatement(java.lang.String tableName,
java.lang.String[] pkNames)
Creates a create index statement |
static java.lang.String |
getTypeString(int type)
Gets the name of the type to be used with the internal dbms |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InnerDBUtils()
Method Detail |
---|
public static java.lang.String buildSQLWhere(java.lang.String[] pks, java.lang.String[] fieldNames)
pks
- String array with the field valuesfieldNames
- String array with the field names
public static java.lang.String createDeleteStatement(Value[] pks, java.lang.String[] names, java.lang.String tableName, ValueWriter vWriter)
pks
- values to specify the row to deletenames
- names of the fieldstableName
- name of the tablevWriter
- DOCUMENT ME!
public static java.lang.String getCreateStatementWithAutonumeric(java.lang.String tableName, java.lang.String[] names, int[] types)
tableName
- Name of the table to be creatednames
- names of the fieldstypes
- types of the fields. Must have the same length than names
public static java.lang.String getCreateStatementWithPK(java.lang.String tableName, java.lang.String[] pkNames, java.lang.String[] names, int[] types)
tableName
- Name of the table to be createdpkNames
- DOCUMENT ME!names
- names of the fieldstypes
- types of the fields. Must have the same length than names
public static java.lang.String getPKIndexStatement(java.lang.String tableName, java.lang.String[] pkNames)
tableName
- table where the index will be createdpkNames
- name of the fields where the index will be created
public static java.lang.String getTypeString(int type)
type
- java.sql.Types constant
java.lang.RuntimeException
- If the Type is not recognizedpublic static java.lang.String createInsertStatement(java.lang.String tableName, Value[] row, java.lang.String[] fieldNames, ValueWriter vWriter)
tableName
- table namerow
- values to be insertedfieldNames
- names of the fields to be insertedvWriter
- DOCUMENT ME!
public static void execute(java.lang.String database, java.lang.String sql) throws java.sql.SQLException
database
- DOCUMENT ME!sql
- DOCUMENT ME!
java.sql.SQLException
- DOCUMENT ME!public static java.lang.String createUpdateStatement(java.lang.String tableName, Value[] pk, java.lang.String[] pkNames, java.lang.String[] fieldNames, Value[] values, ValueWriter vWriter)
tableName
- table namepk
- values of the primary keypkNames
- name of the primary key fieldsfieldNames
- name of all fieldsvalues
- values to be updatedvWriter
- DOCUMENT ME!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |