|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.dao.support.DaoSupport org.springframework.jdbc.core.support.JdbcDaoSupport org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport com.poscoict.glueframework.dao.jdbc.GlueJdbcDao
public class GlueJdbcDao
µ¥ÀÌŸº£À̽º 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 - fetchSize : (¼±ÅÃ) int, default 0 ¿¹Á¦»ç¿ë ¿¹# 1
Field Summary | |
---|---|
protected 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 | ||
---|---|---|
|
batchUpdate(String queryKey,
GlueParameter<P>[] params)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. |
|
|
batchUpdateByQueryStatement(String queryStmt,
GlueParameter<P>[] params)
JDBC 2.0 Specification¿¡ Á¤ÀÇµÈ Batch Update¸¦ ½ÇÇàÇÑ´Ù. |
|
protected JdbcTemplate |
createJdbcTemplate(DataSource dataSource)
|
|
int |
delete(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù. |
|
|
delete(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù. |
|
int |
deleteByQueryStatement(String queryStmt)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù. |
|
|
deleteByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »èÁ¦ÇÑ´Ù. |
|
|
find(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù. |
|
|
find(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù. |
|
|
find(String queryKey,
String whereClause,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®Àå¿¡ where ÀýÀ» Àû¿ëÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù. |
|
|
findByQueryStatement(String queryStmt)
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù. |
|
|
findByQueryStatement(String queryStmt,
GlueParameter<P> param)
SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ °Ë»öÇÑ´Ù. |
|
|
findForNavigationPage(String queryKey,
GlueParameter<P> param,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. |
|
GluePageSet |
findForNavigationPage(String queryKey,
int pageSize,
int curPage)
Page Set ±â´ÉÀ» Áö¿øÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù. |
|
|
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(DataAccessException dae)
JDBC Layer¿¡¼ ¹ß»ýÇÏ´Â DataAccessExceptionÀ» GlueDaoExceptionÀ¸·Î º¯È¯ ½ÃÄÑÁØ´Ù. |
|
int |
insert(String queryKey)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù. |
|
|
insert(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù. |
|
int |
insertByQueryStatement(String queryStmt)
SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Database Record¸¦ »ý¼ºÇÑ´Ù. |
|
|
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 |
setFetchSize(int fetchSize)
setter method for DI. |
|
void |
setLobHandler(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¸¦ ¼öÁ¤ÇÑ´Ù. |
|
|
update(String queryKey,
GlueParameter<P> param)
Äõ¸® Å°¿¡ ÇØ´çÇÏ´Â SQL Äõ¸®¹®ÀåÀ» ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù. |
|
int |
updateByQueryStatement(String queryStmt)
Static SQL Äõ¸®(¹ÙÀεù º¯¼ö°¡ ¾ø´Â Äõ¸®)¸¦ ½ÇÇàÇÏ¿© Á¶°Ç¿¡ ÇØ´çÇÏ´Â Database Record¸¦ ¼öÁ¤ÇÑ´Ù. |
|
|
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 |
---|
protected GlueQueryManager queryManager
protected GlueSequence sequence
protected LobHandler lobHandler
Constructor Detail |
---|
public GlueJdbcDao()
Method Detail |
---|
protected JdbcTemplate createJdbcTemplate(DataSource dataSource)
createJdbcTemplate
in class JdbcDaoSupport
public GlueQueryManager getQueryManager()
GlueGenericJdbcDao
getQueryManager
in interface GlueGenericJdbcDao
public void setQueryManager(GlueQueryManager queryManager)
queryManager
- Query Managerpublic void setColumnManager(GlueColumnManager columnManager)
columnManager
- public void setTypeCast(boolean typeCast)
typeCast
- public GlueSequence getSequence()
GlueGenericJdbcDao
getSequence
in interface GlueGenericJdbcDao
public void setSequence(GlueSequence sequence)
public void setLobHandler(LobHandler lobHandler)
public int getBatchUpdateLimit()
public void setBatchUpdateLimit(int batchUpdateLimit)
batchUpdateLimit
- public void setFetchSize(int fetchSize)
fetchSize
- public String getDatabaseProductName()
public Connection getDBConnection()
public void releaseDBConnection(Connection con)
public <T> List<T> find(String queryKey)
GlueGenericDao
find
in interface GlueGenericDao
queryKey
- Äõ¸® Å°
public <T,P> List<T> find(String queryKey, GlueParameter<P> param)
GlueGenericDao
find
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍ
public <T,P> List<T> find(String queryKey, String whereClause, GlueParameter<P> param)
GlueGenericJdbcDao
find
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°whereClause
- where Àýparam
- ÆĶó¸ÞÅÍ
public <T> List<T> findByQueryStatement(String queryStmt)
GlueGenericJdbcDao
List rowset = dao.findByQueryStatement( "select * from emp" );
findByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àå
public <T,P> List<T> findByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("9999"); GlueParameter param = new GlueParameter
(args); List rowset = dao.findByQueryStatement("select * from emp where empno=?", param);
findByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍ
public GluePageSet findForNavigationPage(String queryKey, int pageSize, int curPage)
GlueGenericJdbcDao
findForNavigationPage
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°pageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£
public <P> GluePageSet findForNavigationPage(String queryKey, GlueParameter<P> param, int pageSize, int curPage)
GlueGenericJdbcDao
findForNavigationPage
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°param
- ¹ÙÀεù ÆĶó¸ÞÅÍpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£
public GluePageSet findForNavigationPageByQuery(String queryStmt, int pageSize, int curPage)
GlueGenericJdbcDao
GluePageSet rowset = dao.findForNavigationPageByQuery( "select * from emp", 15, 5 );
findForNavigationPageByQuery
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®ÀåpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£
public <P> GluePageSet findForNavigationPageByQuery(String queryStmt, GlueParameter<P> param, int pageSize, int curPage)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("10"); GlueParameter param = new GlueParameter
(args); GluePageSet rowset = dao.findForNavigationPageByQuery("select * from emp where deptno=?", param, 15, 5);
findForNavigationPageByQuery
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ¹ÙÀεù ÆĶó¸ÞÅÍpageSize
- ÇÑ È¸é¿¡ Display µÉ ·Î¿ì °³¼öcurPage
- ÇöÀç ÆäÀÌÁö ¹øÈ£
public int update(String queryKey)
GlueGenericDao
update
in interface GlueGenericDao
queryKey
- Äõ¸® Å°
public <P> int update(String queryKey, GlueParameter<P> param)
GlueGenericDao
update
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍ
public int updateByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.updateByQueryStatement( "update emp set ename='guest' where empno=9999" );
updateByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àå
public <P> int updateByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("guest"); args.add("9999"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.updateByQueryStatement("update emp set ename=? where empno=?", param);
updateByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍ
public int insert(String queryKey)
GlueGenericDao
insert
in interface GlueGenericDao
queryKey
- Äõ¸® Å°
public <P> int insert(String queryKey, GlueParameter<P> param)
GlueGenericDao
insert
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍ
public int insertByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.insertByQueryStatement( "insert into emp(EMPNO, ENAME) values(9999,'guest')" );
insertByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àå
public <P> int insertByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("9999"); args.add("guest"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.insertByQueryStatement("insert into emp(EMPNO, ENAME) values(?,?)", param);
insertByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍ
public int delete(String queryKey)
GlueGenericDao
delete
in interface GlueGenericDao
queryKey
- Äõ¸® Å°
public <P> int delete(String queryKey, GlueParameter<P> param)
GlueGenericDao
delete
in interface GlueGenericDao
queryKey
- Äõ¸® Å°param
- ÆĶó¸ÞÅÍ
public int deleteByQueryStatement(String queryStmt)
GlueGenericJdbcDao
int dmlCnt = dao.deleteByQueryStatement( "delete from emp" );
deleteByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àå
public <P> int deleteByQueryStatement(String queryStmt, GlueParameter<P> param)
GlueGenericJdbcDao
List args = new ArrayList(); args.add("10"); GlueParameter param = new GlueParameter
(args); int dmlCnt = dao.deleteByQueryStatement("delete from emp where deptno=?", param);
deleteByQueryStatement
in interface GlueGenericJdbcDao
queryStmt
- SQL Äõ¸®¹®Àåparam
- ÆĶó¸ÞÅÍ
protected GlueDaoException handleDataAccessException(DataAccessException dae)
dae
- DataAccessException
public <P> int[] batchUpdate(String queryKey, GlueParameter<P>[] params)
GlueGenericJdbcDao
final int count = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter [] params = new GlueParameter
[count]; for (int i=0; i
(args); } int[] results = dao.batchUpdate("query-key", params);
Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú ·Î¿ì °³¼öÀÌ´Ù.
batchUpdate
in interface GlueGenericJdbcDao
queryKey
- Äõ¸® Å°params
- GlueParameter Array
public <P> int[] batchUpdateByQueryStatement(String queryStmt, GlueParameter<P>[] params)
GlueGenericJdbcDao
final int count = 10; // batch update¸¦ À§ÇÑ GlueParameter °´Ã¼ ¹è¿ »ý¼º GlueParameter [] params = new GlueParameter
[count]; for (int i=0; i
(args); } int[] results = dao.batchUpdateByQueryStatement("update set
=? where =?", params); Äõ¸® Á¾·ù°¡ ¼·Î ´Ù¸£´Ù¸é °¢°¢ batchUpdate ¸Þ¼Òµå¸¦ È£ÃâÇÏ¸é µÈ´Ù. ¸®ÅϵǴ °á°ú °ªÀº sqlÀ» ½ÇÇàÇÑ °á°ú Row °³¼öÀÌ´Ù.
- Specified by:
batchUpdateByQueryStatement
in interfaceGlueGenericJdbcDao
- Parameters:
queryStmt
- SQL Äõ¸®¹®Àåparams
- GlueParameter Array- Returns:
- °¢°¢ÀÇ Statement°¡ ¼öÇàµÈ ÈÄ ¾÷µ¥ÀÌÆ® µÈ Row °³¼ö ¹è¿
Overview Package Class Use Tree Deprecated Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
Copyright © 2013–2016 POSCO ICT. All rights reserved.