Overview | Package | Class | Use | Tree | Help
| HEADER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ru.biosoft.access
Interface SQLTransformer

public interface SQLTransformer

Adapter for storing/extracting data elements to/from SQL DBMS.

Version: 1.0
See Also: SQLDataCollection

Method Summary
`DataElement` | `create(ResultSet resultSet)` Extract all needed fields from resultSet, and create instance of DataElement.
`String` | `getCountQuery()` Create SQL query for extracting count of data elements in the table.
`String` | `getDeleteQuery(String name)` Create SQL query for delete data element with specified name from the table.
`String` | `getElementExistsQuery(String name)` Create SQL query for test is data element with specified name exists in the table.
`String` | `getElementQuery(String name)` Create SQL query for extracting data element with specified name from table.
`String` | `getInsertQuery(DataElement de)` Create SQL query for insert data element into the table.
`String` | `getSelectQuery()` Create SQL query for extracting all data elements from table.
`Class` | `getTemplateClass()` Return class of object.
`String` | `getUpdateQuery(DataElement de)` Create SQL query for update data element in the table.
`boolean` | `init(DataCollection owner)` Initialize transformer.

Method Detail

### create

    public DataElement create(ResultSet resultSet)
                        throws java.lang.Exception

  Extract all needed fields from resultSet, and create instance of DataElement.
  Parameters:
    resultSet - ResultSet from DBMS.
  Returns: Created data element.
  Throws:
    java.sql.Exception - If error occured.
  See Also:
    getTemplateClass()

### getCountQuery

    public String getCountQuery()

  Create SQL query for extracting count of data elements in the table.
  Returns: SQL query for extracting count of data elements in the table.

### getDeleteQuery

    public String getDeleteQuery(String name)

  Create SQL query for delete data element with specified name from the table.
  Parameters:
    name - Name (PK) of data element that should be removed from the table.
  Returns: SQL query for delete data element with specified name from the table.

### getElementExistsQuery

    public String getElementExistsQuery(String name)

  Create SQL query for test is data element with specified name exists in the table.
  Parameters:
    name - Name (PK) of needed data element.
  Returns: SQL query for testing data element with specified name in the table.

### getElementQuery

    public String getElementQuery(String name)

  Create SQL query for extracting data element with specified name from table.
  Parameters:
    name - Name (PK) of needed data element.
  Returns: SQL query for extracting data element with specified name from table.

### getInsertQuery

    public String getInsertQuery(DataElement de)

  Create SQL query for insert data element into the table.
  Parameters:
    de - Object for which INSERT statement will be generated.
  Returns: SQL query for insert data element into the table.
  See Also:
    getTemplateClass()

### getSelectQuery

    public String getSelectQuery()

  Create SQL query for extracting all data elements from table.
  Returns: SQL query for extracting all data elements from table.

### getTemplateClass

    public Class getTemplateClass()

  Return class of object.
  Returns: Class of transformed object.
  See Also:
    create(java.sql.ResultSet)

### getUpdateQuery

    public String getUpdateQuery(DataElement de)

  Create SQL query for update data element in the table.
  Parameters:
    de - Object for which UPDATE statement will be generated.
  Returns: SQL query for update data element in the table.
  See Also:
    getTemplateClass()

### init

    public boolean init(DataCollection owner)

  Initialize transformer. Must be called by client after SQLTransformer's constructor, and before using instance of SQLTransformer.
  Returns: `true` - if succeeded, `false` - otherwise.

Overview | Package | Class | Use | Tree | Help
| FOOTER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

BOTTOM