View Javadoc

1   package com.loribel.commons.business.abstraction;
2   
3   import com.loribel.commons.exception.*;
4   
5   /***
6    * Interface for Business Object accessor.
7    *
8    * @author Grégory Borelli
9    */
10  public interface GB_BOAccessor
11  {
12      public static final class OPTION
13      {
14          public final static int DEFAULT = 0;
15          public final static int RELOAD = 1;
16          public final static int RELOAD_NEW = 2;
17          public final static int FROM_CACHE = 3;
18      }
19  
20      /***
21       * Get the ids.
22       * 
23       * Use "*" to get all ids.
24       * Use "Project/*" to get all project ids.
25       */
26      String[] getIds(
27              String a_pattern,
28              int a_option)
29          throws GB_LoadException;
30  
31      /***
32       * Save the businessObject.
33       * If a_bo is null, delete it.
34       */
35      void save(
36              GB_SimpleBusinessObject a_bo,
37              String a_id)
38          throws GB_SaveException;
39  
40      GB_SimpleBusinessObject load(
41              String a_id,
42              int a_option)
43          throws GB_LoadException;
44  
45      boolean isExist(
46              String a_id);
47  
48      void clearAll()
49          throws GB_SaveException;
50  
51  }