View Javadoc
1   /*
2    * MoneyWise: Finance Application
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.moneywise.database;
18  
19  import io.github.tonywasher.joceanus.oceanus.base.OceanusException;
20  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWiseDataSet;
21  import io.github.tonywasher.joceanus.moneywise.data.basic.MoneyWisePayeeInfo;
22  import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataSet;
23  import io.github.tonywasher.joceanus.prometheus.data.PrometheusDataValues;
24  import io.github.tonywasher.joceanus.prometheus.database.PrometheusDataStore;
25  import io.github.tonywasher.joceanus.prometheus.database.PrometheusTableDataInfo;
26  
27  /**
28   * TableDataInfo extension for PayeeInfo.
29   *
30   * @author Tony Washer
31   */
32  public class MoneyWiseTablePayeeInfo
33          extends PrometheusTableDataInfo<MoneyWisePayeeInfo> {
34      /**
35       * The name of the table.
36       */
37      protected static final String TABLE_NAME = MoneyWisePayeeInfo.LIST_NAME;
38  
39      /**
40       * Constructor.
41       *
42       * @param pDatabase the database control
43       */
44      protected MoneyWiseTablePayeeInfo(final PrometheusDataStore pDatabase) {
45          super(pDatabase, TABLE_NAME, MoneyWiseTableAccountInfoType.TABLE_NAME, MoneyWiseTablePayee.TABLE_NAME);
46      }
47  
48      @Override
49      protected void declareData(final PrometheusDataSet pData) {
50          final MoneyWiseDataSet myData = (MoneyWiseDataSet) pData;
51          setList(myData.getPayeeInfo());
52      }
53  
54      @Override
55      protected PrometheusDataValues loadValues() throws OceanusException {
56          /* Build data values */
57          return getRowValues(MoneyWisePayeeInfo.OBJECT_NAME);
58      }
59  }