View Javadoc
1   package org.synchronoss.cpo.jdbc;
2   
3   /*-
4    * [[
5    * jdbc
6    * ==
7    * Copyright (C) 2003 - 2026 Exaxis LLC, Synchronoss Technologies Inc
8    * ==
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ]]
23   */
24  
25  import java.io.Serial;
26  import org.synchronoss.cpo.core.CpoException;
27  import org.synchronoss.cpo.core.meta.CpoMetaDescriptor;
28  import org.synchronoss.cpo.core.meta.domain.CpoAttribute;
29  
30  /**
31   * JdbcCpoAttribute. A class that includes the Jdbc specifc attributes that are additional to the
32   * CpoAttribute attributes
33   *
34   * @author david berry
35   */
36  public class JdbcCpoAttribute extends CpoAttribute implements java.io.Serializable, Cloneable {
37  
38    /** Version Id for this class. */
39    @Serial private static final long serialVersionUID = 1L;
40  
41    /** The database table this attribute's column belongs to. */
42    private String dbTable_ = null;
43  
44    /** The database column this attribute is bound to. */
45    private String dbColumn_ = null;
46  
47    /** Constructs a JdbcCpoAttribute */
48    public JdbcCpoAttribute() {}
49  
50    /**
51     * Set the db table associated with this attribute
52     *
53     * @param dbTable - The db table name to set.
54     */
55    public void setDbTable(String dbTable) {
56      dbTable_ = dbTable;
57    }
58  
59    /**
60     * Set the db column associated with this attribute
61     *
62     * @param dbColumn - The db column name to set.
63     */
64    public void setDbColumn(String dbColumn) {
65      dbColumn_ = dbColumn;
66    }
67  
68    /**
69     * Get the db table associated with this attribute
70     *
71     * @return The db table associated with this attribute.
72     */
73    public String getDbTable() {
74      return dbTable_;
75    }
76  
77    /**
78     * Get the db column associated with this attribute
79     *
80     * @return The db column associated with this attribute
81     */
82    public String getDbColumn() {
83      return dbColumn_;
84    }
85  
86    @Override
87    protected void initTransformClass(CpoMetaDescriptor metaDescriptor) throws CpoException {
88      super.initTransformClass(metaDescriptor);
89      // TODO Revisit this. Initializing the java sql type here. Not sure that this is the right
90      // place.
91      setDataTypeInt(metaDescriptor.getDataTypeInt(getDataType()));
92    }
93  }