com.poscoict.glueframework.dao.jdbc
Class GlueJdbcDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.jdbc.core.support.JdbcDaoSupport
          extended by org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
              extended by com.poscoict.glueframework.dao.jdbc.GlueJdbcDao
All Implemented Interfaces:
GlueGenericDao, GlueGenericJdbcDao, org.springframework.beans.factory.InitializingBean

public class GlueJdbcDao
extends org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
implements GlueGenericJdbcDao

µ¥ÀÌŸº£À̽º CRUD(Create, Read, Update, Delete) ¿ÀÆÛ·¹À̼ÇÀ» Ãß»óÈ­ÇÏ¿© Á¦°øÇÏ´Â Data Access Object ¿ÀºêÁ§Æ®.
±âº»ÀûÀ¸·Î config path¿¡ À§Ä¡ÇÑ xxx-query.glue_sql ÆÄÀÏ¿¡ µî·ÏµÈ Query ¹®ÀåÀ» »ç¿ëÇÏÁö¸¸, "ByQueryStatement" ·Î ³¡³ª´Â ¸Þ¼Òµå´Â ¸í½ÃÀûÀ¸·Î Query¹®ÀåÀ» ÆĶó¸ÞÅÍ·Î ³Ñ°ÜÁÖ¾î¾ß ÇÑ´Ù. ³»ºÎÀûÀ¸·Î Spring FrameworkÀÇ JdbcTemplate Ŭ·¡½º¸¦ ÀÌ¿ëÇÏ¿© DAO ÀÇ ¿ÀÆÛ·¹À̼ÇÀ» ±¸ÇöÇÏ¿´´Ù.

 Bean Property
 
 - dataSource : (Çʼö) javax.sql.DataSource 
 
 - queryManager : (Çʼö) com.poscoict.glueframework.dao.manager.GlueQueryManager 
 
 - columnManager : (¼±ÅÃ) com.poscoict.glueframework.dao.manager.GlueColumnManager, default´Â null
 
 - sequence : (¼±ÅÃ) com.poscoict.glueframework.dao.sequence.GlueSequence, 
                      default´Â ÀÚµ¿»ý¼ºµÇ³ª Áö¿øµÇ´Â DB°¡ Á¦ÇÑÀûÀÓ. 
 
 - lobHandler (¼±ÅÃ) org.springframework.jdbc.support.lob.LobHandler,
                      default´Â org.springframework.jdbc.support.lob.DefaultLobHandler
 
 - typeCast : (¼±ÅÃ) boolean( true, false ), default´Â falseÀÓ.
 
 - batchUpdateLimit : (¼±ÅÃ) int, default´Â 30000
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <bean id="dao" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
         <property name="dataSource" ref="dataSource"/>
         <property name="queryManager" ref="queryManager"/>
     </bean>
 


Field Summary
protected  org.springframework.jdbc.support.lob.LobHandler lobHandler
          Lob handler for processing lob type
protected  GlueQueryManager queryManager
          Query Manager
protected  GlueSequence sequence
           
 
Fields inherited from interface com.poscoict.glueframework.dao.jdbc.GlueGenericJdbcDao
DEFAULT_BATCH_UPDATE_SIZE, DELETE, INSERT, SELECT, UPDATE
 
Constructor Summary
GlueJdbcDao()
          »ý¼ºÀÚ(constructor).
 
Method Summary
<P> int[]
batchUpdate(String queryKey, GlueParameter<P>[] params)
          JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
<P> int[]
batchUpdateByQueryStatement(String queryStmt, GlueParameter<P>[] params)
          JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù.
protected  org.springframework.jdbc.core.JdbcTemplate createJdbcTemplate(DataSource dataSource)
           
 int delete(String queryKey)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
<P> int
delete(String queryKey, GlueParameter<P> param)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
 int deleteByQueryStatement(String queryStmt)
          SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
<P> int
deleteByQueryStatement(String queryStmt, GlueParameter<P> param)
          SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
<T> List<T>
find(String queryKey)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
<T,P> List<T>
find(String queryKey, GlueParameter<P> param)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
<T,P> List<T>
find(String queryKey, String whereClause, GlueParameter<P> param)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®Àå¿¡ where ÀýÀ» Àû¿ëÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
<T> List<T>
findByQueryStatement(String queryStmt)
          Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
<T,P> List<T>
findByQueryStatement(String queryStmt, GlueParameter<P> param)
          SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
<P> GluePageSet
findForNavigationPage(String queryKey, GlueParameter<P> param, int pageSize, int curPage)
          Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 GluePageSet findForNavigationPage(String queryKey, int pageSize, int curPage)
          Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
<P> GluePageSet
findForNavigationPageByQuery(String queryStmt, GlueParameter<P> param, int pageSize, int curPage)
          Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 GluePageSet findForNavigationPageByQuery(String queryStmt, int pageSize, int curPage)
          Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 int getBatchUpdateLimit()
           
 String getDatabaseProductName()
          getter method.
 Connection getDBConnection()
          ConnectionÀ» Return ÇÏ´Â Method ÀÌ´Ù.
 GlueQueryManager getQueryManager()
          Query Manager¸¦ ¾ò´Â´Ù.
 GlueSequence getSequence()
          µ¥ÀÌÅͺ£À̽º Sequence °ªÀ» Çڵ鸵ÇÏ´Â GlueSequence¸¦ ȹµæÇÑ´Ù.
protected  GlueDaoException handleDataAccessException(org.springframework.dao.DataAccessException dae)
          JDBC Layer¿¡¼­ ¹ß»ýÇÏ´Â DataAccessExceptionÀ» GlueDaoExceptionÀ¸·Î º¯È¯ ½ÃÄÑÁØ´Ù.
 int insert(String queryKey)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
<P> int
insert(String queryKey, GlueParameter<P> param)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
 int insertByQueryStatement(String queryStmt)
          SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
<P> int
insertByQueryStatement(String queryStmt, GlueParameter<P> param)
          SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
 void releaseDBConnection(Connection con)
           
 void setBatchUpdateLimit(int batchUpdateLimit)
          setter method for DI.
 void setColumnManager(GlueColumnManager columnManager)
          setter method for DI.
 void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)
           
 void setQueryManager(GlueQueryManager queryManager)
          setter method for DI.
 void setSequence(GlueSequence sequence)
           
 void setTypeCast(boolean typeCast)
          setter method for DI.
 int update(String queryKey)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
<P> int
update(String queryKey, GlueParameter<P> param)
          Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
 int updateByQueryStatement(String queryStmt)
          Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
<P> int
updateByQueryStatement(String queryStmt, GlueParameter<P> param)
          SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
 
Methods inherited from class org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport
getNamedParameterJdbcTemplate, initTemplateConfig
 
Methods inherited from class org.springframework.jdbc.core.support.JdbcDaoSupport
checkDaoConfig, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, releaseConnection, setDataSource, setJdbcTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryManager

protected GlueQueryManager queryManager
Query Manager


sequence

protected GlueSequence sequence

lobHandler

protected org.springframework.jdbc.support.lob.LobHandler lobHandler
Lob handler for processing lob type

Constructor Detail

GlueJdbcDao

public GlueJdbcDao()
»ý¼ºÀÚ(constructor).

Method Detail

createJdbcTemplate

protected org.springframework.jdbc.core.JdbcTemplate createJdbcTemplate(DataSource dataSource)
Overrides:
createJdbcTemplate in class org.springframework.jdbc.core.support.JdbcDaoSupport

getQueryManager

public GlueQueryManager getQueryManager()
Description copied from interface: GlueGenericJdbcDao
Query Manager¸¦ ¾ò´Â´Ù.

Specified by:
getQueryManager in interface GlueGenericJdbcDao
Returns:
Query Manager

setQueryManager

public void setQueryManager(GlueQueryManager queryManager)
setter method for DI. Query Manager¸¦ ¼³Á¤ÇÑ´Ù.

Parameters:
queryManager - Query Manager

setColumnManager

public void setColumnManager(GlueColumnManager columnManager)
setter method for DI.

Parameters:
columnManager -

setTypeCast

public void setTypeCast(boolean typeCast)
setter method for DI.

Parameters:
typeCast -

getSequence

public GlueSequence getSequence()
Description copied from interface: GlueGenericJdbcDao
µ¥ÀÌÅͺ£À̽º Sequence °ªÀ» Çڵ鸵ÇÏ´Â GlueSequence¸¦ ȹµæÇÑ´Ù.
Áö¿øµÇ´Â DB - Oracle, IBM DB2, PostgreSQL

Specified by:
getSequence in interface GlueGenericJdbcDao
Returns:
GlueSequence ¿ÀºêÁ§Æ®

setSequence

public void setSequence(GlueSequence sequence)

setLobHandler

public void setLobHandler(org.springframework.jdbc.support.lob.LobHandler lobHandler)

getBatchUpdateLimit

public int getBatchUpdateLimit()

setBatchUpdateLimit

public void setBatchUpdateLimit(int batchUpdateLimit)
setter method for DI.

Parameters:
batchUpdateLimit -

getDatabaseProductName

public String getDatabaseProductName()
getter method.

Returns:

getDBConnection

public Connection getDBConnection()
ConnectionÀ» Return ÇÏ´Â Method ÀÌ´Ù. ConnectionÀ» ÀÌ¿ëÇÏ¿© Statement, PreparedStatement,CallableStatement µîÀ» »ç¿ëÇÏ´Â °æ¿ì ¹Ýµå½Ã ÇØ´ç ÀÚ¿øÀº Close ÇÏ¿©¾ß ÇÑ´Ù. (ConnectionÀº Glue F/W¿¡¼­ ÀÚµ¿À¸·Î Close Çϱ⠶§¹®¿¡ Close ÇÏÁö ¸»¾Æ¾ß ÇÑ´Ù)

Returns:
Connection

releaseDBConnection

public void releaseDBConnection(Connection con)

find

public <T> List<T> find(String queryKey)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.

Specified by:
find in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

find

public <T,P> List<T> find(String queryKey,
                          GlueParameter<P> param)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.

Specified by:
find in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
param - ÆĶó¸ÞÅÍ
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

find

public <T,P> List<T> find(String queryKey,
                          String whereClause,
                          GlueParameter<P> param)
Description copied from interface: GlueGenericJdbcDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®Àå¿¡ where ÀýÀ» Àû¿ëÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.

Specified by:
find in interface GlueGenericJdbcDao
Parameters:
queryKey - Äõ¸® Å°
whereClause - where Àý
param - ÆĶó¸ÞÅÍ
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

findByQueryStatement

public <T> List<T> findByQueryStatement(String queryStmt)
Description copied from interface: GlueGenericJdbcDao
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
 List rowset = dao.findByQueryStatement( "select * from emp" );
 

Specified by:
findByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â RowSet

findByQueryStatement

public <T,P> List<T> findByQueryStatement(String queryStmt,
                                          GlueParameter<P> param)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù.
 List args = new ArrayList();
 args.add("9999");
 GlueParameter<List> param = new GlueParameter<List>(args);
 List rowset = dao.findByQueryStatement("select * from emp where empno=?", param);
 
 

Specified by:
findByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
param - ÆĶó¸ÞÅÍ
Returns:
°Ë»öµÈ ·¹Äڵ带 Ç¥ÇöÇÏ´Â List

findForNavigationPage

public GluePageSet findForNavigationPage(String queryKey,
                                         int pageSize,
                                         int curPage)
Description copied from interface: GlueGenericJdbcDao
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. (°Ô½ÃÆÇ ÇüÅÂ)
ÇÑ ÆäÀÌÁö¿¡ displayµÉ Record °³¼ö¿Í ÇöÀç ÆäÀÌÁö ¹øÈ£¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
(¿¹, pageSize:15, curPage:5 -> 5ÆäÀÌÁö¿¡ ÇØ´çÇÏ´Â Record 15°³¸¦ ¾ò´Â´Ù.)

Specified by:
findForNavigationPage in interface GlueGenericJdbcDao
Parameters:
queryKey - Äõ¸® Å°
pageSize - ÇÑ È­¸é¿¡ Display µÉ ·Î¿ì °³¼ö
curPage - ÇöÀç ÆäÀÌÁö ¹øÈ£
Returns:
Display µÉ RowSet

findForNavigationPage

public <P> GluePageSet findForNavigationPage(String queryKey,
                                             GlueParameter<P> param,
                                             int pageSize,
                                             int curPage)
Description copied from interface: GlueGenericJdbcDao
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. (°Ô½ÃÆÇ ÇüÅÂ)
ÇÑ ÆäÀÌÁö¿¡ displayµÉ Record °³¼ö¿Í ÇöÀç ÆäÀÌÁö ¹øÈ£¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
(¿¹, pageSize:15, curPage:5 -> 5ÆäÀÌÁö¿¡ ÇØ´çÇÏ´Â Record 15°³¸¦ ¾ò´Â´Ù.)

Specified by:
findForNavigationPage in interface GlueGenericJdbcDao
Parameters:
queryKey - Äõ¸® Å°
param - ¹ÙÀεù ÆĶó¸ÞÅÍ
pageSize - ÇÑ È­¸é¿¡ Display µÉ ·Î¿ì °³¼ö
curPage - ÇöÀç ÆäÀÌÁö ¹øÈ£
Returns:
Display µÉ RowSet

findForNavigationPageByQuery

public GluePageSet findForNavigationPageByQuery(String queryStmt,
                                                int pageSize,
                                                int curPage)
Description copied from interface: GlueGenericJdbcDao
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. (°Ô½ÃÆÇ ÇüÅÂ)
ÇÑ ÆäÀÌÁö¿¡ displayµÉ Record °³¼ö¿Í ÇöÀç ÆäÀÌÁö ¹øÈ£¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
(¿¹, pageSize:15, curPage:5 -> 5ÆäÀÌÁö¿¡ ÇØ´çÇÏ´Â Record 15°³¸¦ ¾ò´Â´Ù.)
 GluePageSet rowset = dao.findForNavigationPageByQuery( "select * from emp", 15, 5 );
 

Specified by:
findForNavigationPageByQuery in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
pageSize - ÇÑ È­¸é¿¡ Display µÉ ·Î¿ì °³¼ö
curPage - ÇöÀç ÆäÀÌÁö ¹øÈ£
Returns:
Display µÉ RowSet

findForNavigationPageByQuery

public <P> GluePageSet findForNavigationPageByQuery(String queryStmt,
                                                    GlueParameter<P> param,
                                                    int pageSize,
                                                    int curPage)
Description copied from interface: GlueGenericJdbcDao
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. (°Ô½ÃÆÇ ÇüÅÂ)
ÇÑ ÆäÀÌÁö¿¡ displayµÉ Record °³¼ö¿Í ÇöÀç ÆäÀÌÁö ¹øÈ£¸¦ ÁöÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
(¿¹, pageSize:15, curPage:5 -> 5ÆäÀÌÁö¿¡ ÇØ´çÇÏ´Â Record 15°³¸¦ ¾ò´Â´Ù.)
 List args = new ArrayList();
 args.add("10");
 GlueParameter<List> param = new GlueParameter<List>(args);
 GluePageSet rowset = dao.findForNavigationPageByQuery("select * from emp where deptno=?", param, 15, 5);
 
 

Specified by:
findForNavigationPageByQuery in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
param - ¹ÙÀεù ÆĶó¸ÞÅÍ
pageSize - ÇÑ È­¸é¿¡ Display µÉ ·Î¿ì °³¼ö
curPage - ÇöÀç ÆäÀÌÁö ¹øÈ£
Returns:
Display µÉ RowSet

update

public int update(String queryKey)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.

Specified by:
update in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

update

public <P> int update(String queryKey,
                      GlueParameter<P> param)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.

Specified by:
update in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
param - ÆĶó¸ÞÅÍ
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

updateByQueryStatement

public int updateByQueryStatement(String queryStmt)
Description copied from interface: GlueGenericJdbcDao
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
 int dmlCnt = dao.updateByQueryStatement( "update emp set ename='guest' where empno=9999" );
 

Specified by:
updateByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

updateByQueryStatement

public <P> int updateByQueryStatement(String queryStmt,
                                      GlueParameter<P> param)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù.
 List args = new ArrayList();
 args.add("guest");
 args.add("9999");
 GlueParameter<List> param = new GlueParameter<List>(args);
 int dmlCnt = dao.updateByQueryStatement("update emp set ename=? where empno=?", param);
 
 

Specified by:
updateByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
param - ÆĶó¸ÞÅÍ
Returns:
¼öÁ¤µÈ ·¹ÄÚµå °³¼ö

insert

public int insert(String queryKey)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.

Specified by:
insert in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

insert

public <P> int insert(String queryKey,
                      GlueParameter<P> param)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.

Specified by:
insert in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
param - ÆĶó¸ÞÅÍ
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

insertByQueryStatement

public int insertByQueryStatement(String queryStmt)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
 int dmlCnt = dao.insertByQueryStatement( "insert into emp(EMPNO, ENAME) values(9999,'guest')" );
 

Specified by:
insertByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

insertByQueryStatement

public <P> int insertByQueryStatement(String queryStmt,
                                      GlueParameter<P> param)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù.
 List args = new ArrayList();
 args.add("9999");
 args.add("guest");
 GlueParameter<List> param = new GlueParameter<List>(args);
 int dmlCnt = dao.insertByQueryStatement("insert into emp(EMPNO, ENAME) values(?,?)", param);
 
 

Specified by:
insertByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
param - ÆĶó¸ÞÅÍ
Returns:
»ý¼ºµÈ ·¹ÄÚµå °³¼ö

delete

public int delete(String queryKey)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.

Specified by:
delete in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

delete

public <P> int delete(String queryKey,
                      GlueParameter<P> param)
Description copied from interface: GlueGenericDao
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.

Specified by:
delete in interface GlueGenericDao
Parameters:
queryKey - Äõ¸® Å°
param - ÆĶó¸ÞÅÍ
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

deleteByQueryStatement

public int deleteByQueryStatement(String queryStmt)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
 int dmlCnt = dao.deleteByQueryStatement( "delete from emp" );
 

Specified by:
deleteByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

deleteByQueryStatement

public <P> int deleteByQueryStatement(String queryStmt,
                                      GlueParameter<P> param)
Description copied from interface: GlueGenericJdbcDao
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù.
 List args = new ArrayList();
 args.add("10");
 GlueParameter<List> param = new GlueParameter<List>(args);
 int dmlCnt = dao.deleteByQueryStatement("delete from emp where deptno=?", param);
 
 

Specified by:
deleteByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
param - ÆĶó¸ÞÅÍ
Returns:
»èÁ¦µÈ ·¹ÄÚµå °³¼ö

handleDataAccessException

protected GlueDaoException handleDataAccessException(org.springframework.dao.DataAccessException dae)
JDBC Layer¿¡¼­ ¹ß»ýÇÏ´Â DataAccessExceptionÀ» GlueDaoExceptionÀ¸·Î º¯È¯ ½ÃÄÑÁØ´Ù.
- BadSqlGrammarException, DataIntegrityViolationException, UncategorizedSQLException

Parameters:
dae - DataAccessException
Returns:
GlueDaoException JDBC Layer¿¡¼­ Exception ¹ß»ý ½Ã

batchUpdate

public <P> int[] batchUpdate(String queryKey,
                             GlueParameter<P>[] params)
Description copied from interface: GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.
 final int count = 10;
 // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿­ »ý¼º
 GlueParameter<List>[] params = new GlueParameter<List>[count];
 for (int i=0; i<params.length; i++)
 {
     List args = new ArrayList();
     args.add(dao.getSequence().getNextStringValue("SQ_NAME"));
     args.add("value");
     params[i] = new GlueParameter<List>(args);
 }
 int[] results = dao.batchUpdate("query-key", params);
 
 

Äõ¸® Á¾·ù°¡ ¼­·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú ·Î¿ì °³¼öÀÌ´Ù.

Specified by:
batchUpdate in interface GlueGenericJdbcDao
Parameters:
queryKey - Äõ¸® Å°
params - GlueParameter Array
Returns:
°¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿­

batchUpdateByQueryStatement

public <P> int[] batchUpdateByQueryStatement(String queryStmt,
                                             GlueParameter<P>[] params)
Description copied from interface: GlueGenericJdbcDao
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. JDBC µå¶óÀ̹ö°¡ batch update¸¦ Áö¿øÇÏÁö ¾ÊÀ¸¸é ÀÏ¹Ý Update°¡ ½ÇÇàµÈ´Ù. »ç¿ë ¹æ¹ýÀº ¾Æ·¡ ÂüÁ¶.
 final int count = 10;
 // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿­ »ý¼º
 GlueParameter<List>[] params = new GlueParameter<List>[count];
 for (int i=0; i<params.length; i++)
 {
     List args = new ArrayList();
     args.add(dao.getSequence().getNextStringValue("SQ_NAME"));
     args.add("value");
     params[i] = new GlueParameter<List>(args);
 }
 int[] results = dao.batchUpdateByQueryStatement("update <table> set <column1>=? where <column2>=?", params);
 
 

Äõ¸® Á¾·ù°¡ ¼­·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.

Specified by:
batchUpdateByQueryStatement in interface GlueGenericJdbcDao
Parameters:
queryStmt - SQL Äõ¸®¹®Àå
params - GlueParameter Array
Returns:
°¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿­


Copyright © 2013–2015 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.