View Javadoc

1   /** 2008, Digitalis Informatica. All rights reserved.
2    *
3    * Distribuicao e Gestao de Informatica, Lda.
4    * Estrada de Paco de Arcos num.9 - Piso -1
5    * 2780-666 Paco de Arcos
6    * Telefone: (351) 21 4408990
7    * Fax: (351) 21 4408999
8    * http://www.digitalis.pt
9    */
10  package pt.digitalis.maven.ormgenerator;
11  
12  /**
13   * A DAO definition. Includes the class and package name to generate the Service DAO accessor methods
14   *
15   * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a>
16   * @created Jan 15, 2009
17   */
18  public class DAO {
19  
20      /** The DAO class name */
21      private String className;
22  
23      /** The DAO class schema package name */
24      private String schemaName;
25  
26      /**
27       * Default constructor
28       *
29       * @param schemaName
30       * @param className
31       */
32      public DAO(String schemaName, String className) {
33          this.schemaName = schemaName;
34          this.className = className;
35      }
36  
37      /**
38       * @return the className
39       */
40      public String getClassName() {
41          return className;
42      }
43  
44      /**
45       * @return the schemaName
46       */
47      public String getSchemaName() {
48          return schemaName;
49      }
50  
51      /**
52       * @param className
53       *            the className to set
54       */
55      public void setClassName(String className) {
56          this.className = className;
57      }
58  
59      /**
60       * @param schemaName
61       *            the schemaName to set
62       */
63      public void setSchemaName(String schemaName) {
64          this.schemaName = schemaName;
65      }
66  
67      /**
68       * @return the calculated relative package if inner schema DAO
69       */
70      public String getRelativePackage() {
71          if (schemaName != null && !"".equals(schemaName))
72              return "." + schemaName;
73          else
74              return "";
75      }
76  }