1 /******************************************************************************
2 * ChainsDao.java - Dao interface for the Chains
3 *
4 * PicMan - The BuckoSoft Picture Manager in Java
5 * Copyright(c) 2005 - Dick Balaska
6 *
7 */
8 package com.buckosoft.PicMan.db;
9
10 import java.util.List;
11
12 import org.springframework.dao.DataAccessException;
13
14 import com.buckosoft.PicMan.domain.Chain;
15
16 /** Dao interface for the {@link com.buckosoft.PicMan.domain.Chain}s.
17 * @author Dick Balaska
18 * @since 2006/01/24
19 */
20 public interface ChainsDao {
21
22 /** Get a List of all of the Chains in the Database.
23 * @return The List.
24 * @throws DataAccessException Something went horribly wrong.
25 */
26 public List<Chain> getChains() throws DataAccessException;
27
28 /** Return the number of Chains in the Database.
29 * @return The Count
30 * @throws DataAccessException It broke.
31 */
32 public int getChainCount() throws DataAccessException;
33
34 /** Fetch a <code>Chain</code> based on its name.
35 * @param name The name to query.
36 * @return The chain or <code>null</code> if not found.
37 * @throws DataAccessException Broken database access.
38 */
39 public Chain getChain(String name) throws DataAccessException;
40
41 /** Fetch a <code>Chain</code> based on its Chain ID.
42 * @param cid The Chain ID to query.
43 * @return The chain or <code>null</code> if not found.
44 * @throws DataAccessException Broken database access.
45 */
46 public Chain getChain(int cid) throws DataAccessException;
47
48 /** Store this <code>Chain</code> in the Database.
49 * @param chain The Chain to write.
50 * @throws DataAccessException I don't think so.
51 */
52 public void storeChain(Chain chain) throws DataAccessException;
53
54 /** Delete this <code>Chain</code> from the Database.
55 * @param chain The Chain to delete.
56 * @throws DataAccessException Not happening today.
57 */
58 public void deleteChain(Chain chain) throws DataAccessException;
59
60 }