ID Generation Service 중 Table Id Generation Service 를 적용해서 민원접수번호, FAQ접수번호를 생성한다.
CREATE TABLE ids ( table_name varchar(16) NOT NULL, next_id DECIMAL(30) NOT NULL, PRIMARY KEY (table_name)); INSERT INTO IDS VALUES('RTETNCVPL', 0); INSERT INTO IDS VALUES('RTETNFAQ', 0);
// 민원접수번호 <bean name="egovCvplCnsltIdGnr" class="egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrService" destroy-method="destroy"> <property name="dataSource" ref="dataSource" /> <property name="strategy" ref="mixPrefixCvplCnslt" /> <property name="blockSize" value="10"/> <property name="table" value="ids"/> <property name="tableName" value="RTETNCVPL"/> </bean> <bean name="mixPrefixCvplCnslt" class="egovframework.rte.fdl.idgnr.impl.strategy.EgovIdGnrStrategyImpl"> <property name="prefix" value="CVPL" /> <property name="cipers" value="5" /> <property name="fillChar" value="0" /> </bean> // FAQ접수번호 <bean name="egovCvplFaqIdGnr" class="egovframework.rte.fdl.idgnr.impl.EgovTableIdGnrService" destroy-method="destroy"> <property name="dataSource" ref="dataSource" /> <property name="strategy" ref="mixPrefixCvplFaq" /> <property name="blockSize" value="10"/> <property name="table" value="ids"/> <property name="tableName" value="RTETNFAQ"/> </bean> <bean name="mixPrefixCvplFaq" class="egovframework.rte.fdl.idgnr.impl.strategy.EgovIdGnrStrategyImpl"> <property name="prefix" value="FAQ" /> <property name="cipers" value="6" /> <property name="fillChar" value="0" /> </bean>
// 민원접수번호 @Resource(name="egovCvplCnsltIdGnr") private EgovIdGnrService egovCvplCnsltIdGnr; String id = egovCvplCnsltIdGnr.getNextStringId();
// FAQ접수번호 @Resource(name="egovCvplFaqIdGnr") private EgovIdGnrService egovCvplFaqIdGnr; String id = egovCvplFaqIdGnr.getNextStringId();