Coverage Report - org.kuali.rice.krad.service.impl.SequenceAccessorServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
SequenceAccessorServiceImpl
0%
0/9
0%
0/4
2.333
 
 1  
 /*
 2  
  * Copyright 2005-2007 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in
 5  
  * compliance with the License. You may obtain a copy of the License at
 6  
  * 
 7  
  * http://www.opensource.org/licenses/ecl2.php
 8  
  * 
 9  
  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS
 10  
  * IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
 11  
  * language governing permissions and limitations under the License.
 12  
  */
 13  
 package org.kuali.rice.krad.service.impl;
 14  
 
 15  
 import org.apache.commons.lang.StringUtils;
 16  
 import org.kuali.rice.krad.bo.BusinessObject;
 17  
 import org.kuali.rice.krad.dao.SequenceAccessorDao;
 18  
 import org.kuali.rice.krad.service.SequenceAccessorService;
 19  
 import org.springframework.transaction.annotation.Transactional;
 20  
 
 21  
 @Transactional
 22  0
 public class SequenceAccessorServiceImpl implements SequenceAccessorService {
 23  
     private SequenceAccessorDao sequenceAccessorDao;
 24  
 
 25  
         public Long getNextAvailableSequenceNumber(String sequenceName, 
 26  
                         Class<? extends BusinessObject> clazz) {
 27  0
             if (StringUtils.isBlank(sequenceName)) {
 28  0
                     throw new RuntimeException("Sequence name cannot be blank.");
 29  
             }
 30  0
             return sequenceAccessorDao.getNextAvailableSequenceNumber(sequenceName, clazz);                
 31  
         }
 32  
         
 33  
     /**
 34  
      * @see org.kuali.rice.krad.service.SequenceAccessorService#getNextAvailableSequenceNumber(java.lang.String)
 35  
      */
 36  
     public Long getNextAvailableSequenceNumber(String sequenceName) {
 37  0
             if (StringUtils.isBlank(sequenceName)) {
 38  0
                     throw new RuntimeException("Sequence name cannot be blank.");
 39  
             }
 40  0
             return sequenceAccessorDao.getNextAvailableSequenceNumber(sequenceName);
 41  
     }
 42  
 
 43  
     public void setSequenceAccessorDao(SequenceAccessorDao sequenceAccessorDao) {
 44  0
             this.sequenceAccessorDao = sequenceAccessorDao;
 45  0
     }
 46  
 }