org.mentawai.bean.jdbc
Class MySQLBeanSession

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

public class MySQLBeanSession
extends JdbcBeanSession


Field Summary
 
Fields inherited from class org.mentawai.bean.jdbc.JdbcBeanSession
appManager, conn, DEBUG, loaded
 
Constructor Summary
MySQLBeanSession()
           
MySQLBeanSession(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)
          MySQL is not like Oracle.
 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

MySQLBeanSession

public MySQLBeanSession()

MySQLBeanSession

public MySQLBeanSession(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)
MySQL is not like Oracle. It will SORT everything first and then apply 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.