View Javadoc

1   /*
2    * Copyright (C) 2003-2012 David E. Berry
3    *
4    * This library is free software; you can redistribute it and/or
5    * modify it under the terms of the GNU Lesser General Public
6    * License as published by the Free Software Foundation; either
7    * version 2.1 of the License, or (at your option) any later version.
8    *
9    * This library is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12   * Lesser General Public License for more details.
13   *
14   * You should have received a copy of the GNU Lesser General Public
15   * License along with this library; if not, write to the Free Software
16   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17   *
18   * A copy of the GNU Lesser General Public License may also be found at
19   * http://www.gnu.org/licenses/lgpl.txt
20   */
21  package org.synchronoss.cpo.jdbc.meta;
22  
23  import org.synchronoss.cpo.CpoException;
24  import org.synchronoss.cpo.exporter.MetaXmlObjectExporter;
25  import org.synchronoss.cpo.jdbc.JavaSqlType;
26  import org.synchronoss.cpo.jdbc.exporter.JdbcMetaXmlObjectExporter;
27  import org.synchronoss.cpo.meta.CpoMetaDescriptor;
28  
29  /**
30   *
31   * @author dberry
32   */
33  public class JdbcCpoMetaDescriptor extends CpoMetaDescriptor {
34    private boolean supportsBlobs = false;
35    private boolean supportsCalls = false;
36    private boolean supportsMillis = false;
37    private boolean supportsSelect4Update = false;
38    
39  
40    public JdbcCpoMetaDescriptor(String name, boolean caseSensitive) throws CpoException {
41      super(name, caseSensitive);
42    }
43    
44    @Override
45    protected Class getMetaAdapterClass() throws CpoException {
46      return JdbcCpoMetaAdapter.class;
47    }
48    
49    @Override
50    protected MetaXmlObjectExporter getMetaXmlObjectExporter() {
51      return new JdbcMetaXmlObjectExporter(this);
52    }
53  
54    public boolean isSupportsBlobs() {
55      return supportsBlobs;
56    }
57  
58    public void setSupportsBlobs(boolean supportsBlobs) {
59      this.supportsBlobs = supportsBlobs;
60    }
61  
62    public boolean isSupportsCalls() {
63      return supportsCalls;
64    }
65  
66    public void setSupportsCalls(boolean supportsCalls) {
67      this.supportsCalls = supportsCalls;
68    }
69  
70    public boolean isSupportsMillis() {
71      return supportsMillis;
72    }
73  
74    public void setSupportsMillis(boolean supportsMillis) {
75      this.supportsMillis = supportsMillis;
76    }
77  
78    public boolean isSupportsSelect4Update() {
79      return supportsSelect4Update;
80    }
81  
82    public void setSupportsSelect4Update(boolean supportsSelect4Update) {
83      this.supportsSelect4Update = supportsSelect4Update;
84    }
85    
86    public int getJavaSqlType(String javaSqlTypeName) throws CpoException {
87      return ((JdbcCpoMetaAdapter)getCpoMetaAdapter()).getJavaSqlType(javaSqlTypeName);
88    }
89    
90    public JavaSqlType<?> getJavaSqlType(int sqlType) throws CpoException {
91      return ((JdbcCpoMetaAdapter)getCpoMetaAdapter()).getJavaSqlType(sqlType);
92    }
93  }