com.ibatis.jpetstore.persistence.sqlmapdao
Class SequenceSqlMapDao

java.lang.Object
  extended bycom.ibatis.dao.client.template.DaoTemplate
      extended bycom.ibatis.dao.client.template.SqlMapDaoTemplate
          extended bycom.ibatis.jpetstore.persistence.sqlmapdao.BaseSqlMapDao
              extended bycom.ibatis.jpetstore.persistence.sqlmapdao.SequenceSqlMapDao
All Implemented Interfaces:
com.ibatis.dao.client.Dao, SequenceDao, com.ibatis.sqlmap.client.SqlMapExecutor

public class SequenceSqlMapDao
extends BaseSqlMapDao
implements SequenceDao


Field Summary
 
Fields inherited from class com.ibatis.jpetstore.persistence.sqlmapdao.BaseSqlMapDao
PAGE_SIZE
 
Fields inherited from class com.ibatis.dao.client.template.DaoTemplate
daoManager
 
Constructor Summary
SequenceSqlMapDao(com.ibatis.dao.client.DaoManager daoManager)
           
 
Method Summary
 int getNextId(String name)
          This is a generic sequence ID generator that is based on a database table called 'SEQUENCE', which contains two columns (NAME, NEXTID).
 
Methods inherited from class com.ibatis.dao.client.template.SqlMapDaoTemplate
delete, executeBatch, getSqlMapExecutor, getSqlMapTransactionManager, insert, queryForList, queryForList, queryForMap, queryForMap, queryForObject, queryForObject, queryForPaginatedList, queryWithRowHandler, startBatch, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceSqlMapDao

public SequenceSqlMapDao(com.ibatis.dao.client.DaoManager daoManager)
Method Detail

getNextId

public int getNextId(String name)
This is a generic sequence ID generator that is based on a database table called 'SEQUENCE', which contains two columns (NAME, NEXTID).

This approach should work with any database.

Specified by:
getNextId in interface SequenceDao
Parameters:
name - The name of the sequence.
Returns:
The Next ID


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.