1   /*
2    * Copyright 2003 - 2013 The eFaps Team
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Revision:        $Rev$
17   * Last Changed:    $Date$
18   * Last Changed By: $Author$
19   */
20  
21  package org.efaps.admin.datamodel;
22  
23  import org.efaps.admin.AbstractAdminObject;
24  import org.efaps.db.Context;
25  import org.efaps.util.cache.CacheReloadException;
26  
27  /**
28   * @author The eFaps Team
29   * @version $Id$
30   */
31  public abstract class AbstractDataModelObject
32      extends AbstractAdminObject
33  {
34      /**
35       * Needed for serialization.
36       */
37      private static final long serialVersionUID = 1L;
38  
39      /**
40       * Constructor to set the id and name of the data model object.
41       *
42       * @param _id id to set
43       * @param _uuid universal unique identifier
44       * @param _name name to set
45       */
46      protected AbstractDataModelObject(final long _id,
47                                        final String _uuid,
48                                        final String _name)
49      {
50          super(_id, _uuid, _name);
51      }
52  
53      /**
54       * Initialize the cache of all data model objects.
55       *
56       * @throws CacheReloadException if cache could not be initialized
57       */
58      public static void initialize()
59          throws CacheReloadException
60      {
61          Context.getDbType().initialize(AbstractDataModelObject.class);
62          AttributeType.initialize(AbstractDataModelObject.class);
63          SQLTable.initialize(AbstractDataModelObject.class);
64          Type.initialize(AbstractDataModelObject.class);
65          Dimension.initialize(AbstractDataModelObject.class);
66          Attribute.initialize(AbstractDataModelObject.class);
67          Status.initialize(AbstractDataModelObject.class);
68      }
69  }