org.xerial.db.sql.sqlite
Class SQLiteCatalog

java.lang.Object
  extended by org.xerial.db.sql.sqlite.SQLiteCatalog

public class SQLiteCatalog
extends Object

SQLiteCatalog holds the information of table shamas of a given database.

Author:
leo

Constructor Summary
SQLiteCatalog(SQLiteAccess query)
           
 
Method Summary
 String createValueTupleFromBean(String tableName, Object bean)
          Align the content of a bean object so that it matches with the corresponding relation (table schema) For example, give a bean class, e.g.
 List<SQLiteDataTypeInfo> getKeyAttributeName(String tableName)
           
 Set<String> getTableNameSet()
           
 void reflesh()
           
 String toJSON()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLiteCatalog

public SQLiteCatalog(SQLiteAccess query)
              throws DBException
Throws:
DBException
Method Detail

reflesh

public void reflesh()
             throws DBException
Throws:
DBException

getTableNameSet

public Set<String> getTableNameSet()

toJSON

public String toJSON()

createValueTupleFromBean

public String createValueTupleFromBean(String tableName,
                                       Object bean)
                                throws DBException,
                                       BeanException
Align the content of a bean object so that it matches with the corresponding relation (table schema) For example, give a bean class, e.g. class Person { int id; String name; (getters are ommited) } and a table named person with a schema 'id, name', the createValueTupleFromBean("person", (a Person object)) will give a tuple representation of the Person object (id=1, name="leo"), that is '1,"leo"'. This returned string can be used as it is within an insert statement of the SQL, i.e., insert into person values(1, "leo")

Parameters:
tableName -
bean -
Returns:
Throws:
DBException
InvalidBeanException
BeanException

getKeyAttributeName

public List<SQLiteDataTypeInfo> getKeyAttributeName(String tableName)
                                             throws DBException
Throws:
DBException


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.