View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.gl.batch.dataaccess.impl;
17  
18  import org.kuali.ole.gl.batch.dataaccess.OrganizationReversionUnitOfWorkDao;
19  import org.kuali.rice.core.framework.persistence.jdbc.dao.PlatformAwareDaoBaseJdbc;
20  
21  /**
22   * A JDBC implementation of the OrganizationReversionUnitOfWorkDao...we had to use this because PersistenceService
23   * truncated tables, which is something you can't do on tables with primary keys.
24   */
25  public class OrganizationReversionUnitOfWorkDaoJdbc extends PlatformAwareDaoBaseJdbc implements OrganizationReversionUnitOfWorkDao {
26      org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(getClass());
27  
28      /**
29       * Deletes all existing records in gl_org_rvrsn_ctgry_amt_t and gl_org_rvrsn_unit_wrk_t
30       * 
31       * @see org.kuali.ole.gl.batch.dataaccess.OrganizationReversionUnitOfWorkDao#destroyAllUnitOfWorkSummaries()
32       */
33      public void destroyAllUnitOfWorkSummaries() {
34          LOG.info("Attempting to wipe out all unit of work summaries");
35          getSimpleJdbcTemplate().update("delete from GL_ORG_RVRSN_CTGRY_AMT_T");
36          getSimpleJdbcTemplate().update("delete from GL_ORG_RVRSN_UNIT_WRK_T");
37          LOG.info("All unit of work summaries should be now removed");
38      }
39  
40  }