View Javadoc

1   /*
2    * File:    IBackEndAttributeInformation.java
3    * Created: 23.2.2006 10:43:19
4    *
5    * Copyright 2007 Michal Burda.
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20   */
21  
22  package net.sf.webmancer.db;
23  
24  /**
25   * @author Michal Burda
26   */
27  public interface IBackEndAttributeInformation extends ICommonAttributeInformation {
28      /**
29       * Returns <code>true</code> if the attribute is directly stored in the persistent storage. If <code>false</code>,
30       * the attribute represents information that has not to be directly stored in the database, e.g. if this attribute's
31       * value is used in computation of some other's attribute value.
32       * 
33       * @return <code>true</code> if the attribute is directly stored in the database, <code>false</code> otherwise.
34       */
35      boolean isInDatabase();
36  
37      /**
38       * Returns <code>true</code> if the attribute's value is derived (computed) from some others' attributes' values.
39       * If <code>false</code>, the attribute's value is not computed, i.e. it is always specified by the user.
40       * 
41       * @return <code>true</code> if the attribute's value is derived from values of other attributes,
42       *         <code>false</code> otherwise.
43       */
44      boolean isDerived();
45  
46      /**
47       * @param dbValue
48       * @return
49       */
50      Object convertDbToInternal(Object dbValue);
51  }