View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling 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. 
3   	$Id
4   */
5   
6   package com.hack23.cia.service.dao;
7   
8   import java.io.Serializable;
9   import java.util.List;
10  
11  import com.hack23.cia.model.core.impl.BaseEntity;
12  
13  /***
14   * The Interface GenericDAO.
15   *
16   * @param <T> the generic type
17   * @param <ID> the generic type
18   */
19  public abstract interface GenericDAO<T extends BaseEntity, ID extends Serializable> {
20  
21      /***
22       * Delete.
23       *
24       * @param entity the entity
25       */
26      void delete(T entity);
27  
28      /***
29       * Gets the all.
30       *
31       * @return the all
32       */
33      List<T> getAll();
34  
35      /***
36       * Load.
37       *
38       * @param id the id
39       * @return the t
40       */
41      T load(ID id);
42  
43      /***
44       * Save.
45       *
46       * @param entity the entity
47       * @return the t
48       */
49      T save(T entity);
50  }