org.mentawai.bean.jdbc
Class H2BeanSession

java.lang.Object
  extended by org.mentawai.bean.jdbc.JdbcBeanSession
      extended by org.mentawai.bean.jdbc.H2BeanSession
All Implemented Interfaces:
BeanSession

public class H2BeanSession
extends JdbcBeanSession

H2 supports AUTOINCREMENT and SEQUENCE

Author:
Sergio Oliveira Jr.

Field Summary
 
Fields inherited from class org.mentawai.bean.jdbc.JdbcBeanSession
appManager, conn, DEBUG, loaded
 
Constructor Summary
H2BeanSession()
           
H2BeanSession(java.sql.Connection conn)
           
 
Method Summary
protected  java.lang.String getNow()
           
protected  java.lang.StringBuilder handleLimit(java.lang.StringBuilder sb, java.lang.String orderBy, int limit)
           
 void insert(java.lang.Object bean)
          Insert the bean in the database.
 
Methods inherited from class org.mentawai.bean.jdbc.JdbcBeanSession
add, beginTransaction, buildSelect, buildSelect, buildSelectMinus, buildSelectMinus, countJoin, delete, getConnection, getValueFromBean, getValueFromBean, injectValue, isSet, load, loadJoin, loadJoinIds, loadList, loadList, loadList, loadList, loadListMinus, loadListMinus, loadListMinus, loadListMinus, populateBean, populateBean, populateBeanMinus, populateBeanMinus, remove, setConn, setConnection, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2BeanSession

public H2BeanSession()

H2BeanSession

public H2BeanSession(java.sql.Connection conn)
Method Detail

getNow

protected java.lang.String getNow()
Overrides:
getNow in class JdbcBeanSession

handleLimit

protected java.lang.StringBuilder handleLimit(java.lang.StringBuilder sb,
                                              java.lang.String orderBy,
                                              int limit)
Overrides:
handleLimit in class JdbcBeanSession

insert

public void insert(java.lang.Object bean)
            throws java.lang.Exception
Description copied from interface: BeanSession
Insert the bean in the database. Depending on the type of PK, the generation of the PK can and should be taken care by the DB itself. The generated PK should be inserted in the bean by reflection. The default, database-independent implementation of this method must only insert all fields in the database not worrying about PK generation issues.

Specified by:
insert in interface BeanSession
Overrides:
insert in class JdbcBeanSession
Parameters:
bean - The bean to insert
Throws:
java.lang.Exception


Copyright © 2005 Mentawai Team. All Rights Reserved.