1 /*** 2 * License Agreement. 3 * 4 * JSPA (POJO-SP) 5 * 6 * Copyright (C) 2009 HRX Pty Ltd 7 * 8 * This file is part of JSPA. 9 * 10 * JSPA is free software: you can redistribute it and/or modify it under the 11 * terms of the GNU Lesser General Public License version 3 as published by the 12 * Free Software Foundation. 13 * 14 * JSPA is distributed in the hope that it will be useful, but WITHOUT ANY 15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 16 * A PARTICULAR PURPOSE. See the Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with JSPA. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 package com.hrx.rasp.util.dao.operation; 22 23 import java.sql.Connection; 24 import java.sql.SQLException; 25 import java.util.Set; 26 27 import javax.sql.DataSource; 28 29 import com.hrx.rasp.util.dao.annotations.IN; 30 import com.hrx.rasp.util.dao.annotations.INOUT; 31 import com.hrx.rasp.util.dao.annotations.OUT; 32 import com.hrx.rasp.util.dao.exception.RecordNotFoundException; 33 import com.hrx.rasp.util.dao.exception.StoredProcedureException; 34 import com.hrx.rasp.util.dao.exception.StoredProcedurePrepareException; 35 import com.hrx.rasp.util.dao.exception.StoredProcedureProccessResultException; 36 import com.hrx.rasp.util.dao.metadata.StoredProcField; 37 import com.hrx.rasp.util.dao.metadata.StoredProcMetaDataImpl; 38 39 /*** 40 * @author dan.stoica <dan.stoica@acslink.net.au> 41 * 42 */ 43 public interface DAOCommand 44 { 45 46 public Object execute() throws StoredProcedurePrepareException, StoredProcedureException, 47 SQLException, StoredProcedureProccessResultException, RecordNotFoundException; 48 49 public void setDataSource(DataSource dataSource); 50 51 public void setSpBean(Object spBean); 52 53 public void setMetaData(StoredProcMetaDataImpl meta); 54 55 /*** 56 * @return the storedProc 57 */ 58 public String getStoredProcName(); 59 60 /*** 61 * @return the params IN 62 */ 63 public abstract Set<StoredProcField<IN>> getInParameters(); 64 65 /*** 66 * @return the paramsOUT 67 */ 68 public abstract Set<StoredProcField<OUT>> getOutParameters(); 69 70 /*** 71 * @return the paramsOUT 72 */ 73 public abstract Set<StoredProcField<INOUT>> getInOutParameters(); 74 75 public abstract Set<StoredProcField<?>> getPrimaryKeyParameters(); 76 77 public abstract Connection getConnection() throws SQLException; 78 79 }