public class EgovTableIdGnrServiceImpl extends AbstractDataBlockIdGnrService
NOTE: 채번 테이블을 정의하고, 각 관리대상에 대한 현재 최종 Max 번호를 관리하여 Table 기반의 유일키를 제공 받을 수 있다.
필요한 테이블 생성 스크립트
CREATE TABLE ids (
table_name varchar(16) NOT NULL,
next_id INTEGER NOT NULL,
PRIMARY KEY (table_name)
);
== 개정이력(Modification Information) == 수정일 수정자 수정내용 ------- -------- --------------------------- 2009.02.01 김태호 최초 생성 2013.03.25 한성곤 필드명 속성 처리, JdbcTemplate 방식으로 변경, 초기 id 값 등록(자동 insert 처리), 반복처리 제외 2013.09.04 한성곤 TransactionTemplate을 통해 transaction 처리 분리 2014.08.18 한성곤 명명규칙 클래스 명 변경
blockSizedataSource, mNextId, querymessageSource, useBigDecimals| Constructor and Description |
|---|
EgovTableIdGnrServiceImpl()
생성자
|
| Modifier and Type | Method and Description |
|---|---|
protected BigDecimal |
allocateBigDecimalIdBlock(int blockSize)
blockSize 대로 ID 지정(BigDecimal)
|
protected long |
allocateLongIdBlock(int blockSize)
blockSize 대로 ID 지정(long)
|
void |
setDataSource(DataSource dataSource)
Configuration에 정의된 Datasource를 Setting
|
void |
setNextIdFieldName(String nextIdFieldName)
Next Id 정보를 보관하는 필드명 정보 지정
|
void |
setTable(String table)
ID생성을 위한 테이블 정보 Injection
|
void |
setTableName(String tableName)
ID 생성을 위한 테이블의 키정보 ( 대개의경우는 대상 테이블명을 기재함 )
|
void |
setTableNameFieldName(String tableNameFieldName)
테이블명(구분값)에 대한 테이블 필드명 정보 지정
|
afterPropertiesSet, getNextBigDecimalIdInner, getNextLongIdInner, setBlockSizedestroy, getConnection, setQuerygetNextBigDecimalId, getNextByteId, getNextIntegerId, getNextLongId, getNextLongIdChecked, getNextShortId, getNextStringId, getNextStringId, getNextStringId, getStrategy, isUsingBigDecimals, setApplicationContext, setBeanFactory, setStrategy, setUseBigDecimalsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNextBigDecimalId, getNextByteId, getNextIntegerId, getNextLongId, getNextShortId, getNextStringId, getNextStringId, getNextStringIdpublic void setDataSource(DataSource dataSource)
AbstractDataIdGnrServicesetDataSource in class AbstractDataIdGnrServicedataSource - dataSource 정보protected BigDecimal allocateBigDecimalIdBlock(int blockSize) throws FdlException
allocateBigDecimalIdBlock in class AbstractDataBlockIdGnrServiceblockSize - 지정되는 blockSizeFdlException - ID생성을 위한 블럭 할당이 불가능할때protected long allocateLongIdBlock(int blockSize)
throws FdlException
allocateLongIdBlock in class AbstractDataBlockIdGnrServiceblockSize - 지정되는 blockSizeFdlException - ID생성을 위한 블럭 할당이 불가능할때public void setTable(String table)
table - config로 지정되는 정보public void setTableName(String tableName)
tableName - config로 지정되는 정보public void setTableNameFieldName(String tableNameFieldName)
tableNameFieldName - public void setNextIdFieldName(String nextIdFieldName)
nextIdFieldName - Copyright © 2015. All rights reserved.