// Copyright 2004-2014 Jim Voris
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package com.qumasoft.server.dataaccess;
import com.qumasoft.server.datamodel.Branch;
import java.sql.SQLException;
import java.util.List;
/**
* Branch DAO interface.
* @author Jim Voris
*/
public interface BranchDAO {
/**
* Find all branches.
*
* @return a List of all the branches.
*/
List<Branch> findAll();
/**
* Find the branch by branch id.
*
* @param branchId the branch id.
* @return the Branch with the given id, or null if the branch is not found.
*/
Branch findById(Integer branchId);
/**
* Find the branch by project id and branch name.
*
* @param projectId the project id.
* @param branchName the name of the branch on the given project.
* @return the Branch in the given project with the given name, or null if the branch is not found.
*/
Branch findByProjectIdAndBranchName(Integer projectId, String branchName);
/**
* Insert a row in the BRANCH table.
*
* @param branch the branch to create. Note that we do <b>not</b> honor any branch id passed in with the branch object. A new
* branch will <b>always</b> be created.
*
* @throws SQLException thrown if there is a problem.
*/
void insert(Branch branch) throws SQLException;
/**
* Delete the given branch object.
*
* @param branch the branch object to delete.
* @throws SQLException thrown if there is a problem.
*/
void delete(Branch branch) throws SQLException;
}