DNA SVN: r640 - in trunk/extensions: dna-common-jdbc and 44 other directories.
by dna-commits@lists.jboss.org
Author: lisbor
Date: 2008-11-18 08:00:30 -0500 (Tue, 18 Nov 2008)
New Revision: 640
Added:
trunk/extensions/dna-common-jdbc/
trunk/extensions/dna-common-jdbc/.classpath
trunk/extensions/dna-common-jdbc/.project
trunk/extensions/dna-common-jdbc/.settings/
trunk/extensions/dna-common-jdbc/.settings/org.eclipse.jdt.core.prefs
trunk/extensions/dna-common-jdbc/.settings/org.maven.ide.eclipse.prefs
trunk/extensions/dna-common-jdbc/pom.xml
trunk/extensions/dna-common-jdbc/src/
trunk/extensions/dna-common-jdbc/src/main/
trunk/extensions/dna-common-jdbc/src/main/java/
trunk/extensions/dna-common-jdbc/src/main/java/org/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/JdbcMetadataI18n.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/DefaultModelFactory.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/ModelFactory.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Attribute.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifier.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifierScopeType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Catalog.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Column.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ColumnPseudoType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/CoreMetaData.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Database.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseMetaDataMethodException.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseNamedObject.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKey.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKeyColumn.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Index.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexColumn.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyColumn.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyDeferrabilityType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyModifyRuleType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/NullabilityType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Parameter.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ParameterIoType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKey.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKeyColumn.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Privilege.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrivilegeType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Reference.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetConcurrencyType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetHoldabilityType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SQLStateType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Schema.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SchemaObject.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SearchabilityType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SortSequenceType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeConversionPair.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeInfo.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedure.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedureResultType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Table.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableColumn.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TransactionIsolationLevelType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/UserDefinedType.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/AttributeBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CatalogBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ParameterBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBean.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDataSourceDatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDriverDatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProvider.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/util/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/util/DatabaseUtil.java
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/sequencers/
trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/sequencers/JdbcSequencer.java
trunk/extensions/dna-common-jdbc/src/main/resources/
trunk/extensions/dna-common-jdbc/src/main/resources/org/
trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/
trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/
trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/
trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/jdbc/
trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/jdbc/JdbcMetadataI18n.properties
trunk/extensions/dna-common-jdbc/src/test/
trunk/extensions/dna-common-jdbc/src/test/java/
trunk/extensions/dna-common-jdbc/src/test/java/org/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/ModelFactoryTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/AttributeBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CatalogBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ParameterBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBeanTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProviderTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProviderTest.java
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/util/
trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/util/DatabaseUtilTest.java
trunk/extensions/dna-common-jdbc/src/test/resources/
trunk/extensions/dna-sequencer-jdbc-metadata/
trunk/extensions/dna-sequencer-jdbc-metadata/.classpath
trunk/extensions/dna-sequencer-jdbc-metadata/.project
trunk/extensions/dna-sequencer-jdbc-metadata/.settings/
trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.eclipse.jdt.core.prefs
trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.maven.ide.eclipse.prefs
trunk/extensions/dna-sequencer-jdbc-metadata/pom.xml
trunk/extensions/dna-sequencer-jdbc-metadata/src/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/jdbc/
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/jdbc/JdbcMetadataI18n.java
trunk/extensions/dna-sequencer-jdbc-metadata/src/main/resources/
trunk/extensions/dna-sequencer-jdbc-metadata/src/test/
trunk/extensions/dna-sequencer-jdbc-metadata/src/test/java/
trunk/extensions/dna-sequencer-jdbc-metadata/src/test/resources/
Log:
DNA-37 Federate schema information from relational sources
https://jira.jboss.org/jira/browse/DNA-37
Common classes to extract database metadata using JDBC
Added: trunk/extensions/dna-common-jdbc/.classpath
===================================================================
--- trunk/extensions/dna-common-jdbc/.classpath (rev 0)
+++ trunk/extensions/dna-common-jdbc/.classpath 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/extensions/dna-common-jdbc/.project
===================================================================
--- trunk/extensions/dna-common-jdbc/.project (rev 0)
+++ trunk/extensions/dna-common-jdbc/.project 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>dna-common-jdbc</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/extensions/dna-common-jdbc/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/extensions/dna-common-jdbc/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/extensions/dna-common-jdbc/.settings/org.eclipse.jdt.core.prefs 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,5 @@
+#Mon Nov 17 23:04:18 EST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/extensions/dna-common-jdbc/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- trunk/extensions/dna-common-jdbc/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ trunk/extensions/dna-common-jdbc/.settings/org.maven.ide.eclipse.prefs 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,8 @@
+#Mon Nov 17 23:04:18 EST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: trunk/extensions/dna-common-jdbc/pom.xml
===================================================================
--- trunk/extensions/dna-common-jdbc/pom.xml (rev 0)
+++ trunk/extensions/dna-common-jdbc/pom.xml 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,60 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>dna</artifactId>
+ <groupId>org.jboss.dna</groupId>
+ <version>0.4-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <!-- The groupId and version values are inherited from parent -->
+ <artifactId>dna-common-jdbc</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss DNA JDBC Common model</name>
+ <description>JBoss DNA Common Model that stores JDBC related metadata</description>
+ <url>http://labs.jboss.org/dna</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-graph</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.0</version>
+ </dependency>
+
+ <!--
+ Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for testing)
+ -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.7</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/JdbcMetadataI18n.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/JdbcMetadataI18n.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/JdbcMetadataI18n.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc;
+
+import java.util.Locale;
+import java.util.Set;
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public final class JdbcMetadataI18n {
+ public static I18n databaseConnectionHasBeenReleased;
+ public static I18n errorClosingDatabaseConnection;
+ public static I18n databaseConnectionHasBeenEstablished;
+ public static I18n unableToGetValueFromColumn;
+
+ static {
+ try {
+ I18n.initialize(JdbcMetadataI18n.class);
+ } catch (final Exception err) {
+ System.err.println(err);
+ }
+ }
+
+ public static Set<Locale> getLocalizationProblemLocales() {
+ return I18n.getLocalizationProblemLocales(JdbcMetadataI18n.class);
+ }
+
+ public static Set<String> getLocalizationProblems() {
+ return I18n.getLocalizationProblems(JdbcMetadataI18n.class);
+ }
+
+ public static Set<String> getLocalizationProblems( Locale locale ) {
+ return I18n.getLocalizationProblems(JdbcMetadataI18n.class, locale);
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/DefaultModelFactory.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/DefaultModelFactory.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/DefaultModelFactory.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,232 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model;
+
+import org.jboss.dna.common.jdbc.model.api.*;
+import org.jboss.dna.common.jdbc.model.spi.*;
+
+/**
+ * Database metadata objects creation factory
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DefaultModelFactory implements ModelFactory {
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Default constructor
+ */
+ public DefaultModelFactory() {
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Creates Attribute
+ *
+ * @return Attribute
+ */
+ public Attribute createAttribute() {
+ return new AttributeBean();
+ }
+
+ /**
+ * Creates BestRowIdentifier
+ *
+ * @return BestRowIdentifier object
+ */
+ public BestRowIdentifier createBestRowIdentifier() {
+ return new BestRowIdentifierBean();
+ }
+
+ /**
+ * Creates Catalog
+ *
+ * @return Catalog object
+ */
+ public Catalog createCatalog() {
+ return new CatalogBean();
+ }
+
+ /**
+ * Creates Database
+ *
+ * @return Database object
+ */
+ public Database createDatabase() {
+ return new DatabaseBean();
+ }
+
+ /**
+ * Creates ForeignKey
+ *
+ * @return ForeignKey object
+ */
+ public ForeignKey createForeignKey() {
+ return new ForeignKeyBean();
+ }
+
+ /**
+ * Creates ForeignKeyColumn
+ *
+ * @return ForeignKeyColumn object
+ */
+ public ForeignKeyColumn createForeignKeyColumn() {
+ return new ForeignKeyColumnBean();
+ }
+
+ /**
+ * Creates Index
+ *
+ * @return Index object
+ */
+ public Index createIndex() {
+ return new IndexBean();
+ }
+
+ /**
+ * Creates IndexColumn
+ *
+ * @return IndexColumn object
+ */
+ public IndexColumn createIndexColumn() {
+ return new IndexColumnBean();
+ }
+
+ /**
+ * Creates Parameter
+ *
+ * @return Parameter object
+ */
+ public Parameter createParameter() {
+ return new ParameterBean();
+ }
+
+ /**
+ * Creates PrimaryKey
+ *
+ * @return PrimaryKey object
+ */
+ public PrimaryKey createPrimaryKey() {
+ return new PrimaryKeyBean();
+ }
+
+ /**
+ * Creates PrimaryKeyColumn
+ *
+ * @return PrimaryKeyColumn object
+ */
+ public PrimaryKeyColumn createPrimaryKeyColumn() {
+ return new PrimaryKeyColumnBean();
+ }
+
+ /**
+ * Creates Privilege
+ *
+ * @return Privilege object
+ */
+ public Privilege createPrivilege() {
+ return new PrivilegeBean();
+ }
+
+ /**
+ * Creates Reference
+ *
+ * @return Reference object
+ */
+ public Reference createReference() {
+ return new ReferenceBean();
+ }
+
+ /**
+ * Creates Schema
+ *
+ * @return Schema object
+ */
+ public Schema createSchema() {
+ return new SchemaBean();
+ }
+
+ /**
+ * Creates SqlTypeConversionPair
+ *
+ * @return SqlTypeConversionPair object
+ */
+ public SqlTypeConversionPair createSqlTypeConversionPair() {
+ return new SqlTypeConversionPairBean();
+ }
+
+ /**
+ * Creates SqlTypeInfo
+ *
+ * @return SqlTypeInfo object
+ */
+ public SqlTypeInfo createSqlTypeInfo() {
+ return new SqlTypeInfoBean();
+ }
+
+ /**
+ * Creates StoredProcedure
+ *
+ * @return StoredProcedure object
+ */
+ public StoredProcedure createStoredProcedure() {
+ return new StoredProcedureBean();
+ }
+
+ /**
+ * Creates Table
+ *
+ * @return Table object
+ */
+ public Table createTable() {
+ return new TableBean();
+ }
+
+ /**
+ * Creates TableColumn
+ *
+ * @return TableColumn object
+ */
+ public TableColumn createTableColumn() {
+ return new TableColumnBean();
+ }
+
+ /**
+ * Creates TableType
+ *
+ * @return TableType object
+ */
+ public TableType createTableType() {
+ return new TableTypeBean();
+ }
+
+ /**
+ * Creates UserDefinedType
+ *
+ * @return UserDefinedType object
+ */
+ public UserDefinedType createUserDefinedType() {
+ return new UserDefinedTypeBean();
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/ModelFactory.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/ModelFactory.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/ModelFactory.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model;
+
+import org.jboss.dna.common.jdbc.model.api.*;
+
+/**
+ * Database metadata objects creation factory
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface ModelFactory {
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Creates Attribute
+ *
+ * @return Attribute
+ */
+ Attribute createAttribute();
+
+ /**
+ * Creates BestRowIdentifier
+ *
+ * @return BestRowIdentifier object
+ */
+ BestRowIdentifier createBestRowIdentifier();
+
+ /**
+ * Creates Catalog
+ *
+ * @return Catalog object
+ */
+ Catalog createCatalog();
+
+ /**
+ * Creates Database
+ *
+ * @return Database object
+ */
+ Database createDatabase();
+
+ /**
+ * Creates ForeignKey
+ *
+ * @return ForeignKey object
+ */
+ ForeignKey createForeignKey();
+
+ /**
+ * Creates ForeignKeyColumn
+ *
+ * @return ForeignKeyColumn object
+ */
+ ForeignKeyColumn createForeignKeyColumn();
+
+ /**
+ * Creates Index
+ *
+ * @return Index object
+ */
+ Index createIndex();
+
+ /**
+ * Creates IndexColumn
+ *
+ * @return IndexColumn object
+ */
+ IndexColumn createIndexColumn();
+
+ /**
+ * Creates Parameter
+ *
+ * @return Parameter object
+ */
+ Parameter createParameter();
+
+ /**
+ * Creates PrimaryKey
+ *
+ * @return PrimaryKey object
+ */
+ PrimaryKey createPrimaryKey();
+
+ /**
+ * Creates PrimaryKeyColumn
+ *
+ * @return PrimaryKeyColumn object
+ */
+ PrimaryKeyColumn createPrimaryKeyColumn();
+
+ /**
+ * Creates Privilege
+ *
+ * @return Privilege object
+ */
+ Privilege createPrivilege();
+
+ /**
+ * Creates Reference
+ *
+ * @return Reference object
+ */
+ Reference createReference();
+
+ /**
+ * Creates Schema
+ *
+ * @return Schema object
+ */
+ Schema createSchema();
+
+ /**
+ * Creates SqlTypeConversionPair
+ *
+ * @return SqlTypeConversionPair object
+ */
+ SqlTypeConversionPair createSqlTypeConversionPair();
+
+ /**
+ * Creates SqlTypeInfo
+ *
+ * @return SqlTypeInfo object
+ */
+ SqlTypeInfo createSqlTypeInfo();
+
+ /**
+ * Creates StoredProcedure
+ *
+ * @return StoredProcedure object
+ */
+ StoredProcedure createStoredProcedure();
+
+ /**
+ * Creates Table
+ *
+ * @return Table object
+ */
+ Table createTable();
+
+ /**
+ * Creates TableColumn
+ *
+ * @return TableColumn object
+ */
+ TableColumn createTableColumn();
+
+ /**
+ * Creates TableType
+ *
+ * @return TableType object
+ */
+ TableType createTableType();
+
+ /**
+ * Creates UserDefinedType
+ *
+ * @return UserDefinedType object
+ */
+ UserDefinedType createUserDefinedType();
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Attribute.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Attribute.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Attribute.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides User Defined Type (UDT) attribute specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.4 (JDBC 3.0)
+ */
+public interface Attribute extends Column {
+ /**
+ * Returns column reference if datatype is REF
+ *
+ * @return column reference if datatype is REF
+ */
+ Reference getReference();
+
+ /**
+ * Sets reference
+ *
+ * @param reference the reference to set
+ */
+ void setReference( Reference reference );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifier.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifier.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifier.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides table's best row identifies specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface BestRowIdentifier extends CoreMetaData {
+
+ /**
+ * Return the scope of best row identifier
+ *
+ * @return the scope of best row identifier
+ */
+ BestRowIdentifierScopeType getScopeType();
+
+ /**
+ * Sets the scope of best row identifier
+ *
+ * @param scopeType the scope of best row identifier
+ */
+ void setScopeType( BestRowIdentifierScopeType scopeType );
+
+ /**
+ * Retrieves best row identifier columns
+ *
+ * @return best row identifier columns
+ */
+ Set<Column> getColumns();
+
+ /**
+ * Adds column to the best row identifier
+ *
+ * @param column the column that part of best row identifier
+ */
+ void addColumn( Column column );
+
+ /**
+ * Deletes column from the best row identifier
+ *
+ * @param column the column that no longer part of best row identifier
+ */
+ void deleteColumn( Column column );
+
+ /**
+ * Searches column by name
+ *
+ * @param columnName the column name to search
+ * @return column if found, otherwise return null
+ */
+ Column findColumnByName( String columnName );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifierScopeType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifierScopeType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/BestRowIdentifierScopeType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported best row identifier scope types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum BestRowIdentifierScopeType {
+
+ TEMPORARY(DatabaseMetaData.bestRowTemporary), // Indicates that the scope is very temporary, lasting only while the row is
+ // being used.
+ TRANSACTION(DatabaseMetaData.bestRowTransaction), // Indicates that the scope is the remainder of the current transaction.
+ SESSION(DatabaseMetaData.bestRowSession); // Indicates that the scope is the remainder of the current session.
+
+ private final int scope;
+
+ BestRowIdentifierScopeType( int scope ) {
+ this.scope = scope;
+ }
+
+ public int getScope() {
+ return scope;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Catalog.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Catalog.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Catalog.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all core database catalog specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Catalog extends DatabaseNamedObject {
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Column.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Column.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Column.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides all column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Column extends DatabaseNamedObject {
+
+ /**
+ * Returns owner of ColumnMetaData such as Table, or Stored Procedure, UDT, PK, FK, Index, etc. May return NULL
+ *
+ * @return owner of ColumnMetaData such as Table, or Stored Procedure, or UDT, PK, FK, Index, etc. May return NULL
+ */
+ SchemaObject getOwner();
+
+ /**
+ * Sets the owner of ColumnMetaData
+ *
+ * @param owner the owner of ColumnMetaData
+ */
+ void setOwner( SchemaObject owner );
+
+ /**
+ * Gets column nullability
+ *
+ * @return column nullability
+ */
+ NullabilityType getNullabilityType();
+
+ /**
+ * Sets column nullability
+ *
+ * @param nullabilityType the column nullability
+ */
+ void setNullabilityType( NullabilityType nullabilityType );
+
+ /**
+ * Gets SQL type from java.sql.Types
+ *
+ * @return SQL type from java.sql.Types
+ */
+ SqlType getSqlType();
+
+ /**
+ * Sets SQL type from java.sql.Types
+ *
+ * @param sqlType the SQL type from java.sql.Types
+ */
+ void setSqlType( SqlType sqlType );
+
+ /**
+ * Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified
+ * and represents the target type of the reference type.
+ *
+ * @return data source dependent type name
+ */
+ String getTypeName();
+
+ /**
+ * Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified
+ * and represents the target type of the reference type.
+ *
+ * @param typeName data source dependent type name
+ */
+ void setTypeName( String typeName );
+
+ /**
+ * Gets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is
+ * precision. For Stored procedure columns it is length in bytes of data
+ *
+ * @return column size
+ */
+ Integer getSize();
+
+ /**
+ * Sets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is
+ * precision. For Stored procedure columns it is length in bytes of data
+ *
+ * @param size the column size
+ */
+ void setSize( Integer size );
+
+ /**
+ * Gets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure
+ * column - scale.
+ *
+ * @return precision if applicable otherwise 0
+ */
+ Integer getPrecision();
+
+ /**
+ * Sets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure
+ * column - scale.
+ *
+ * @param precision the precision if applicable otherwise 0
+ */
+ void setPrecision( Integer precision );
+
+ /**
+ * Gets radix if applicable
+ *
+ * @return radix if applicable
+ */
+ Integer getRadix();
+
+ /**
+ * Sets radix if applicable
+ *
+ * @param radix if applicable
+ */
+ void setRadix( Integer radix );
+
+ /**
+ * Gets default value (may be <code>null</code>)
+ *
+ * @return default value (may be <code>null</code>)
+ */
+ String getDefaultValue();
+
+ /**
+ * Sets default value (may be <code>null</code>)
+ *
+ * @param defaultValue the default value (may be <code>null</code>)
+ */
+ void setDefaultValue( String defaultValue );
+
+ /**
+ * Returns index of column starting at 1 - if applicable. Otherwise returns -1.
+ *
+ * @return index of column starting at 1 - if applicable. Otherwise returns -1.
+ */
+ Integer getOrdinalPosition();
+
+ /**
+ * Sets index of column starting at 1 - if applicable. Otherwise returns -1.
+ *
+ * @param ordinalPosition the index of column starting at 1 - if applicable. Otherwise returns -1.
+ */
+ void setOrdinalPosition( Integer ordinalPosition );
+
+ /**
+ * For char types returns the maximum number of bytes in the column. Otherwise returns -1. May return null.
+ *
+ * @return For char types returns the maximum number of bytes in the column. Otherwise returns -1. May return null.
+ */
+ Integer getCharOctetLength();
+
+ /**
+ * For char types sets the maximum number of bytes in the column. Otherwise -1.
+ *
+ * @param CharOctetLength For char types sets the maximum number of bytes in the column. Otherwise -1.
+ */
+ void setCharOctetLength( Integer charOctetLength );
+
+ /**
+ * Gets table column privileges.
+ *
+ * @return set of table column privileges
+ */
+ Set<Privilege> getPrivileges();
+
+ /**
+ * Adds table column priviledge
+ *
+ * @param privilege the table column priviledge
+ */
+ void addPrivilege( Privilege privilege );
+
+ /**
+ * Deletes table column priviledge
+ *
+ * @param privilege the table column priviledge
+ */
+ void deletePrivilege( Privilege privilege );
+
+ /**
+ * Searches priviledge by name
+ *
+ * @param priviledgeName the priviledge name to search
+ * @return priviledge if found, otherwise return null
+ */
+ Privilege findPriviledgeByName( String priviledgeName );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ColumnPseudoType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ColumnPseudoType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ColumnPseudoType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides RDBMS supported best row identifier pseudo types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum ColumnPseudoType {
+
+ UNKNOWN(0), // Indicates that the column may or may not be a pseudo column.
+ NOT_PSEUDO(1), // Indicates that the column is NOT a pseudo column.
+ PSEUDO(2); // Indicates that the column is a pseudo column.
+
+ private final int type;
+
+ ColumnPseudoType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/CoreMetaData.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/CoreMetaData.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/CoreMetaData.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.io.Serializable;
+
+/**
+ * Provides core metadata functionality
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface CoreMetaData extends Serializable {
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Database.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Database.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Database.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,3016 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Provides RDBMS wide meta data retrieved from java.sql.DatabaseMetaData.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Database extends CoreMetaData {
+
+ /**
+ * Returns list of failed database metadata methods through the DatabaseMetaDataMethodExceptions
+ *
+ * @return list of failed database metadata methods through the DatabaseMetaDataMethodExceptions
+ */
+ List<DatabaseMetaDataMethodException> getExceptionList();
+
+ /**
+ * Adds the DatabaseMetaDataMethodException to the DatabaseMetadataProvider exception list
+ *
+ * @param exception the DatabaseMetaDataMethodException
+ */
+ void addException( DatabaseMetaDataMethodException exception );
+
+ /**
+ * Searches the DatabaseMetaDataMethodException by method name
+ *
+ * @param methodName the name of method that caused exception
+ * @return the DatabaseMetaDataMethodException if found, otherwise returns null
+ */
+ DatabaseMetaDataMethodException findException( String methodName );
+
+ /**
+ * Checks that specified database metadata method of provider is failed or not
+ *
+ * @param methodName the name of method that caused exception
+ * @return true if method failed; false otherwise
+ */
+ boolean isDatabaseMetaDataMethodFailed( String methodName );
+
+ /**
+ * Gets database name
+ *
+ * @return database name
+ */
+ String getName();
+
+ /**
+ * Sets database name
+ *
+ * @param name the database name
+ */
+ void setName( String name );
+
+ // ----------------------------------------------------------------------
+ // A variety of minor information about the target database.
+ // ----------------------------------------------------------------------
+
+ /**
+ * Retrieves whether the current user can call all the procedures returned by the method
+ * <code>DatabaseMetaData.getProcedures</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isAllProceduresAreCallable();
+
+ /**
+ * sets whether the current user can call all the procedures returned by the method
+ * <code>DatabaseMetaData.getProcedures</code>.
+ *
+ * @param allProceduresAreCallable <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setAllProceduresAreCallable( Boolean allProceduresAreCallable );
+
+ /**
+ * Retrieves whether the current user can use all the tables returned by the method <code>DatabaseMetaData.getTables</code> in
+ * a <code>SELECT</code> statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isAllTablesAreSelectable();
+
+ /**
+ * Sets whether the current user can use all the tables returned by the method <code>DatabaseMetaData.getTables</code> in a
+ * <code>SELECT</code> statement.
+ *
+ * @param allTablesAreSelectable <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setAllTablesAreSelectable( Boolean allTablesAreSelectable );
+
+ /**
+ * Retrieves the URL for this DBMS.
+ *
+ * @return the URL for this DBMS or <code>null</code> if it cannot be generated
+ */
+ String getURL();
+
+ /**
+ * Sets the URL for this DBMS.
+ *
+ * @param url the URL for this DBMS or <code>null</code> if it cannot be generated
+ */
+ void setURL( String url );
+
+ /**
+ * Retrieves the user name as known to this database.
+ *
+ * @return the database user name
+ */
+ String getUserName();
+
+ /**
+ * Sets the user name as known to this database.
+ *
+ * @param userName the database user name
+ */
+ void setUserName( String userName );
+
+ /**
+ * Retrieves whether this database is in read-only mode.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isReadOnly();
+
+ /**
+ * Sets whether this database is in read-only mode.
+ *
+ * @param readOnly <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setReadOnly( Boolean readOnly );
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted high. Sorted high means that <code>NULL</code> values sort higher
+ * than any other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values
+ * will appear at the end. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtEnd</code> indicates whether
+ * <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isNullsAreSortedHigh();
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted high. Sorted high means that <code>NULL</code> values sort higher than any
+ * other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the end. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtEnd</code> indicates whether
+ * <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @param nullsAreSortedHigh <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setNullsAreSortedHigh( Boolean nullsAreSortedHigh );
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted low. Sorted low means that <code>NULL</code> values sort lower than
+ * any other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the beginning. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtStart</code> indicates whether
+ * <code>NULL</code> values are sorted at the beginning regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isNullsAreSortedLow();
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted low. Sorted low means that <code>NULL</code> values sort lower than any
+ * other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the beginning. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtStart</code> indicates whether
+ * <code>NULL</code> values are sorted at the beginning regardless of sort order.
+ *
+ * @param nullsAreSortedLow <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setNullsAreSortedLow( Boolean nullsAreSortedLow );
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted at the start regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isNullsAreSortedAtStart();
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted at the start regardless of sort order.
+ *
+ * @param nullsAreSortedAtStart <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setNullsAreSortedAtStart( Boolean nullsAreSortedAtStart );
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isNullsAreSortedAtEnd();
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @param nullsAreSortedAtEnd <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setNullsAreSortedAtEnd( Boolean nullsAreSortedAtEnd );
+
+ /**
+ * Retrieves the name of this database product.
+ *
+ * @return database product name
+ */
+ String getDatabaseProductName();
+
+ /**
+ * Sets the name of this database product.
+ *
+ * @param databaseProductName database product name
+ */
+ void setDatabaseProductName( String databaseProductName );
+
+ /**
+ * Retrieves the version number of this database product.
+ *
+ * @return database version number
+ */
+ String getDatabaseProductVersion();
+
+ /**
+ * Sets the version number of this database product.
+ *
+ * @param databaseProductVersion database version number
+ */
+ void setDatabaseProductVersion( String databaseProductVersion );
+
+ /**
+ * Retrieves the name of this JDBC driver.
+ *
+ * @return JDBC driver name
+ */
+ String getDriverName();
+
+ /**
+ * Sets the name of this JDBC driver.
+ *
+ * @param driverName JDBC driver name
+ */
+ void setDriverName( String driverName );
+
+ /**
+ * Retrieves the version number of this JDBC driver as a <code>String</code>.
+ *
+ * @return JDBC driver version
+ */
+ String getDriverVersion();
+
+ /**
+ * Sets the version number of this JDBC driver as a <code>String</code>.
+ *
+ * @param driverVersion the JDBC driver version
+ */
+ void setDriverVersion( String driverVersion );
+
+ /**
+ * Retrieves this JDBC driver's minor version number.
+ *
+ * @return JDBC driver minor version number
+ */
+ Integer getDriverMajorVersion();
+
+ /**
+ * Sets this JDBC driver's major version number.
+ *
+ * @param driverMajorVersion the JDBC driver major version
+ */
+ void setDriverMajorVersion( Integer driverMajorVersion );
+
+ /**
+ * Retrieves this JDBC driver's minor version number.
+ *
+ * @return JDBC driver minor version number
+ */
+ Integer getDriverMinorVersion();
+
+ /**
+ * Sets this JDBC driver's minor version number.
+ *
+ * @param driverMinorVersion the JDBC driver minor version number
+ */
+ void setDriverMinorVersion( Integer driverMinorVersion );
+
+ /**
+ * Retrieves whether this database stores tables in a local file.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isUsesLocalFiles();
+
+ /**
+ * Sets whether this database stores tables in a local file.
+ *
+ * @param usesLocalFiles <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setUsesLocalFiles( Boolean usesLocalFiles );
+
+ /**
+ * Retrieves whether this database uses a file for each table.
+ *
+ * @return <code>true</code> if this database uses a local file for each table; <code>false</code> otherwise
+ */
+ Boolean isUsesLocalFilePerTable();
+
+ /**
+ * Sets whether this database uses a file for each table.
+ *
+ * @param usesLocalFilePerTable <code>true</code> if this database uses a local file for each table; <code>false</code>
+ * otherwise
+ */
+ void setUsesLocalFilePerTable( Boolean usesLocalFilePerTable );
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsMixedCaseIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @param supportsMixedCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsMixedCaseIdentifiers( Boolean supportsMixedCaseIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in upper
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresUpperCaseIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @param storesUpperCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresUpperCaseIdentifiers( Boolean storesUpperCaseIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in lower
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresLowerCaseIdentifiers();
+
+ /**
+ * sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @param storesLowerCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresLowerCaseIdentifiers( Boolean storesLowerCaseIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in mixed
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresMixedCaseIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @param storesMixedCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresMixedCaseIdentifiers( Boolean storesMixedCaseIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsMixedCaseQuotedIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case sensitive and as a result stores them in mixed
+ * case.
+ *
+ * @param supportsMixedCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsMixedCaseQuotedIdentifiers( Boolean supportsMixedCaseQuotedIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresUpperCaseQuotedIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @param storesUpperCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresUpperCaseQuotedIdentifiers( Boolean storesUpperCaseQuotedIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresLowerCaseQuotedIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @param storesLowerCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresLowerCaseQuotedIdentifiers( Boolean storesLowerCaseQuotedIdentifiers );
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isStoresMixedCaseQuotedIdentifiers();
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @param storesMixedCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setStoresMixedCaseQuotedIdentifiers( Boolean storesMixedCaseQuotedIdentifiers );
+
+ /**
+ * Retrieves the string used to quote SQL identifiers. This method returns a space " " if identifier quoting is not supported.
+ *
+ * @return the quoting string or a space if quoting is not supported
+ */
+ String getIdentifierQuoteString();
+
+ /**
+ * Sets the string used to quote SQL identifiers. This method returns a space " " if identifier quoting is not supported.
+ *
+ * @param identifierQuoteString the quoting string or a space if quoting is not supported
+ */
+ void setIdentifierQuoteString( String identifierQuoteString );
+
+ /**
+ * Retrieves a list of all of this database's SQL keywords that are NOT also SQL92 keywords.
+ *
+ * @return the list of this database's keywords that are not also SQL92 keywords
+ */
+ Set<String> getSQLKeywords();
+
+ /**
+ * Adds SQL keyword
+ *
+ * @param sqlKeyword the SQL keyword to add
+ */
+ void addSQLKeyword( String sqlKeyword );
+
+ /**
+ * Deletes SQL keyword
+ *
+ * @param sqlKeyword the SQL keyword to delete
+ */
+ void deleteSQLKeyword( String sqlKeyword );
+
+ /**
+ * Is SQL keyword supported
+ *
+ * @param sqlKeyword the SQL keyword to search
+ * @return true if supported; false otherwiose
+ */
+ Boolean isSQLKeywordSupported( String sqlKeyword );
+
+ /**
+ * Retrieves a list of math functions available with this database. These are the Open /Open CLI math function names used in
+ * the JDBC function escape clause.
+ *
+ * @return the list of math functions supported by this database
+ */
+ Set<String> getNumericFunctions();
+
+ /**
+ * Adds numeric function
+ *
+ * @param functionName the name of numeric function to add
+ */
+ void addNumericFunction( String functionName );
+
+ /**
+ * Deletes numeric function
+ *
+ * @param functionName the name of numeric function to delete
+ */
+ void deleteNumericFunction( String functionName );
+
+ /**
+ * Is Numeric function supported
+ *
+ * @param functionName the name of numeric function
+ * @return true is supported; false otherwise
+ */
+ Boolean isNumericFunctionSupported( String functionName );
+
+ /**
+ * Retrieves a list of string functions available with this database. These are the Open Group CLI string function names used
+ * in the JDBC function escape clause.
+ *
+ * @return the list of string functions supported by this database
+ */
+ Set<String> getStringFunctions();
+
+ /**
+ * Adds String function
+ *
+ * @param functionName the name of String function to add
+ */
+ void addStringFunction( String functionName );
+
+ /**
+ * Deletes String function
+ *
+ * @param functionName the name of String function to delete
+ */
+ void deleteStringFunction( String functionName );
+
+ /**
+ * Is String function supported
+ *
+ * @param functionName the name of String function
+ * @return true is supported; false otherwise
+ */
+ Boolean isStringFunctionSupported( String functionName );
+
+ /**
+ * Retrieves a list of system functions available with this database. These are the Open Group CLI system function names used
+ * in the JDBC function escape clause.
+ *
+ * @return a list of system functions supported by this database
+ */
+ Set<String> getSystemFunctions();
+
+ /**
+ * Adds System function
+ *
+ * @param functionName the name of System function to add
+ */
+ void addSystemFunction( String functionName );
+
+ /**
+ * deletes System function
+ *
+ * @param functionName the name of System function to delete
+ */
+ void deleteSystemFunction( String functionName );
+
+ /**
+ * Is System function supported
+ *
+ * @param functionName the name of System function
+ * @return true is supported; false otherwise
+ */
+ Boolean isSystemFunctionSupported( String functionName );
+
+ /**
+ * Retrieves a list of the time and date functions available with this database.
+ *
+ * @return the list of time and date functions supported by this database
+ */
+ Set<String> getTimeDateFunctions();
+
+ /**
+ * Adds Time/Date function
+ *
+ * @param functionName the name of Time/Date function to add
+ */
+ void addTimeDateFunction( String functionName );
+
+ /**
+ * deletes Time/Date function
+ *
+ * @param functionName the name of Time/Date function to delete
+ */
+ void deleteTimeDateFunction( String functionName );
+
+ /**
+ * Is Time/Date function supported
+ *
+ * @param functionName the name of Time/Date function
+ * @return true is supported; false otherwise
+ */
+ Boolean isTimeDateFunctionSupported( String functionName );
+
+ /**
+ * Retrieves the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or
+ * '%' in the catalog search parameters that are a pattern (and therefore use one of the wildcard characters).
+ * <P>
+ * The '_' character represents any single character; the '%' character represents any sequence of zero or more characters.
+ *
+ * @return the string used to escape wildcard characters
+ */
+ String getSearchStringEscape();
+
+ /**
+ * Sets the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or '%' in
+ * the catalog search parameters that are a pattern (and therefore use one of the wildcard characters).
+ * <P>
+ * The '_' character represents any single character; the '%' character represents any sequence of zero or more characters.
+ *
+ * @param searchStringEscape the string used to escape wildcard characters
+ */
+ void setSearchStringEscape( String searchStringEscape );
+
+ /**
+ * Retrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
+ *
+ * @return the string containing the extra characters
+ */
+ String getExtraNameCharacters();
+
+ /**
+ * Sets all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
+ *
+ * @param extraNameCharacters the string containing the extra characters
+ */
+ void setExtraNameCharacters( String extraNameCharacters );
+
+ // --------------------------------------------------------------------
+ // Functions describing which features are supported.
+ // --------------------------------------------------------------------
+
+ /**
+ * Retrieves whether this database supports <code>ALTER TABLE</code> with add column.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsAlterTableWithAddColumn();
+
+ /**
+ * Sets whether this database supports <code>ALTER TABLE</code> with add column.
+ *
+ * @param supportsAlterTableWithAddColumn <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsAlterTableWithAddColumn( Boolean supportsAlterTableWithAddColumn );
+
+ /**
+ * Retrieves whether this database supports <code>ALTER TABLE</code> with drop column.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsAlterTableWithDropColumn();
+
+ /**
+ * Sets whether this database supports <code>ALTER TABLE</code> with drop column.
+ *
+ * @param supportsAlterTableWithDropColumn <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsAlterTableWithDropColumn( Boolean supportsAlterTableWithDropColumn );
+
+ /**
+ * Retrieves whether this database supports column aliasing.
+ * <P>
+ * If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as
+ * required.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsColumnAliasing();
+
+ /**
+ * Sets whether this database supports column aliasing.
+ * <P>
+ * If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as
+ * required.
+ *
+ * @param supportsColumnAliasing <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsColumnAliasing( Boolean supportsColumnAliasing );
+
+ /**
+ * Retrieves whether this database supports concatenations between <code>NULL</code> and non-<code>NULL</code> values being
+ * <code>NULL</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isNullPlusNonNullIsNull();
+
+ /**
+ * Sets whether this database supports concatenations between <code>NULL</code> and non-<code>NULL</code> values being
+ * <code>NULL</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setNullPlusNonNullIsNull( Boolean nullPlusNonNullIsNull );
+
+ /**
+ * Retrieves whether this database supports the <code>CONVERT</code> function between SQL types.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsConvert();
+
+ /**
+ * Sets whether this database supports the <code>CONVERT</code> function between SQL types.
+ *
+ * @param supportsConvert <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsConvert( Boolean supportsConvert );
+
+ /**
+ * Retrieves whether this database supports the <code>CONVERT</code> for given SQL types. It uses original
+ * <code>DatabaseMetaData.supportsConvert</code> to check common (NOT ALL POSSIBLE) conversions.
+ *
+ * @return list of common (NOT ALL POSSIBLE) conversions.
+ * @see Types
+ */
+ Set<SqlTypeConversionPair> getSupportedConversions();
+
+ /**
+ * Adds SqlTypeConversionPair
+ *
+ * @param sqlTypeConversionPair the SqlTypeConversionPair
+ */
+ void addSqlTypeConversionPair( SqlTypeConversionPair sqlTypeConversionPair );
+
+ /**
+ * deletes SqlTypeConversionPair
+ *
+ * @param sqlTypeConversionPair the SqlTypeConversionPair
+ */
+ void deleteSqlTypeConversionPair( SqlTypeConversionPair sqlTypeConversionPair );
+
+ /**
+ * Searches set of SqlTypeConversionPair by SrcType
+ *
+ * @return set of SqlTypeConversionPair
+ */
+ Set<SqlTypeConversionPair> findSqlTypeConversionPairBySrcType( String srcType );
+
+ /**
+ * Retrieves whether this database supports table correlation names.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsTableCorrelationNames();
+
+ /**
+ * Sets whether this database supports table correlation names.
+ *
+ * @param supportsTableCorrelationNames <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsTableCorrelationNames( Boolean supportsTableCorrelationNames );
+
+ /**
+ * Retrieves whether, when table correlation names are supported, they are restricted to being different from the names of the
+ * tables.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsDifferentTableCorrelationNames();
+
+ /**
+ * Sets whether, when table correlation names are supported, they are restricted to being different from the names of the
+ * tables.
+ *
+ * @param supportsDifferentTableCorrelationNames <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsDifferentTableCorrelationNames( Boolean supportsDifferentTableCorrelationNames );
+
+ /**
+ * Retrieves whether this database supports expressions in <code>ORDER BY</code> lists.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsExpressionsInOrderBy();
+
+ /**
+ * Sets whether this database supports expressions in <code>ORDER BY</code> lists.
+ *
+ * @param supportsExpressionsInOrderBy <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsExpressionsInOrderBy( Boolean supportsExpressionsInOrderBy );
+
+ /**
+ * Retrieves whether this database supports using a column that is not in the <code>SELECT</code> statement in an
+ * <code>ORDER BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsOrderByUnrelated();
+
+ /**
+ * Sets whether this database supports using a column that is not in the <code>SELECT</code> statement in an
+ * <code>ORDER BY</code> clause.
+ *
+ * @param <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsOrderByUnrelated( Boolean supportsOrderByUnrelated );
+
+ /**
+ * Retrieves whether this database supports some form of <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsGroupBy();
+
+ /**
+ * Sets whether this database supports some form of <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupBy <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsGroupBy( Boolean supportsGroupBy );
+
+ /**
+ * Retrieves whether this database supports using a column that is not in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsGroupByUnrelated();
+
+ /**
+ * Sets whether this database supports using a column that is not in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupByUnrelated <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsGroupByUnrelated( Boolean supportsGroupByUnrelated );
+
+ /**
+ * Retrieves whether this database supports using columns not included in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause provided that all of the columns in the <code>SELECT</code> statement are included in the
+ * <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsGroupByBeyondSelect();
+
+ /**
+ * Sets whether this database supports using columns not included in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause provided that all of the columns in the <code>SELECT</code> statement are included in the
+ * <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupByBeyondSelect <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsGroupByBeyondSelect( Boolean supportsGroupByBeyondSelect );
+
+ /**
+ * Retrieves whether this database supports specifying a <code>LIKE</code> escape clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsLikeEscapeClause();
+
+ /**
+ * Sets whether this database supports specifying a <code>LIKE</code> escape clause.
+ *
+ * @param supportsLikeEscapeClause <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsLikeEscapeClause( Boolean supportsLikeEscapeClause );
+
+ /**
+ * Retrieves whether this database supports getting multiple <code>ResultSet</code> objects from a single call to the method
+ * <code>execute</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsMultipleResultSets();
+
+ /**
+ * Sets whether this database supports getting multiple <code>ResultSet</code> objects from a single call to the method
+ * <code>execute</code>.
+ *
+ * @param supportsMultipleResultSets <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsMultipleResultSets( Boolean supportsMultipleResultSets );
+
+ /**
+ * Retrieves whether this database allows having multiple transactions open at once (on different connections).
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsMultipleTransactions();
+
+ /**
+ * Sets whether this database allows having multiple transactions open at once (on different connections).
+ *
+ * @param supportsMultipleTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsMultipleTransactions( Boolean supportsMultipleTransactions );
+
+ /**
+ * Retrieves whether columns in this database may be defined as non-nullable.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsNonNullableColumns();
+
+ /**
+ * Sets whether columns in this database may be defined as non-nullable.
+ *
+ * @param supportsNonNullableColumns <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsNonNullableColumns( Boolean supportsNonNullableColumns );
+
+ /**
+ * Retrieves whether this database supports the ODBC Minimum SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsMinimumSQLGrammar();
+
+ /**
+ * Sets whether this database supports the ODBC Minimum SQL grammar.
+ *
+ * @param supportsMinimumSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsMinimumSQLGrammar( Boolean supportsMinimumSQLGrammar );
+
+ /**
+ * Retrieves whether this database supports the ODBC Core SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCoreSQLGrammar();
+
+ /**
+ * Sets whether this database supports the ODBC Core SQL grammar.
+ *
+ * @param supportsCoreSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCoreSQLGrammar( Boolean supportsCoreSQLGrammar );
+
+ /**
+ * Retrieves whether this database supports the ODBC Extended SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsExtendedSQLGrammar();
+
+ /**
+ * Sets whether this database supports the ODBC Extended SQL grammar.
+ *
+ * @param supportsExtendedSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsExtendedSQLGrammar( Boolean supportsExtendedSQLGrammar );
+
+ /**
+ * Retrieves whether this database supports the ANSI92 entry level SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsANSI92EntryLevelSQL();
+
+ /**
+ * Sets whether this database supports the ANSI92 entry level SQL grammar.
+ *
+ * @param supportsANSI92EntryLevelSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsANSI92EntryLevelSQL( Boolean supportsANSI92EntryLevelSQL );
+
+ /**
+ * Retrieves whether this database supports the ANSI92 intermediate SQL grammar supported.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsANSI92IntermediateSQL();
+
+ /**
+ * Sets whether this database supports the ANSI92 intermediate SQL grammar supported.
+ *
+ * @param supportsANSI92IntermediateSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsANSI92IntermediateSQL( Boolean supportsANSI92IntermediateSQL );
+
+ /**
+ * Retrieves whether this database supports the ANSI92 full SQL grammar supported.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsANSI92FullSQL();
+
+ /**
+ * Sets whether this database supports the ANSI92 full SQL grammar supported.
+ *
+ * @param supportsANSI92FullSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsANSI92FullSQL( Boolean supportsANSI92FullSQL );
+
+ /**
+ * Retrieves whether this database supports the SQL Integrity Enhancement Facility.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsIntegrityEnhancementFacility();
+
+ /**
+ * Sets whether this database supports the SQL Integrity Enhancement Facility.
+ *
+ * @param supportsIntegrityEnhancementFacility <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsIntegrityEnhancementFacility( Boolean supportsIntegrityEnhancementFacility );
+
+ /**
+ * Retrieves whether this database supports some form of outer join.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsOuterJoins();
+
+ /**
+ * Sets whether this database supports some form of outer join.
+ *
+ * @param supportsOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsOuterJoins( Boolean supportsOuterJoins );
+
+ /**
+ * Retrieves whether this database supports full nested outer joins.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsFullOuterJoins();
+
+ /**
+ * Sets whether this database supports full nested outer joins.
+ *
+ * @param supportsFullOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsFullOuterJoins( Boolean supportsFullOuterJoins );
+
+ /**
+ * Retrieves whether this database provides limited support for outer joins. (This will be <code>true</code> if the method
+ * <code>DatabaseMetaData.supportsFullOuterJoins</code> returns <code>true</code>).
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsLimitedOuterJoins();
+
+ /**
+ * Sets whether this database provides limited support for outer joins. (This will be <code>true</code> if the method
+ * <code>DatabaseMetaData.supportsFullOuterJoins</code> returns <code>true</code>).
+ *
+ * @param supportsLimitedOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsLimitedOuterJoins( Boolean supportsLimitedOuterJoins );
+
+ /**
+ * Retrieves the database vendor's preferred term for "schema".
+ *
+ * @return the vendor term for "schema"
+ */
+ String getSchemaTerm();
+
+ /**
+ * Sets the database vendor's preferred term for "schema".
+ *
+ * @param schemaTerm the vendor term for "schema"
+ */
+ void setSchemaTerm( String schemaTerm );
+
+ /**
+ * Retrieves the database vendor's preferred term for "procedure".
+ *
+ * @return the vendor term for "procedure"
+ */
+ String getProcedureTerm();
+
+ /**
+ * Sets the database vendor's preferred term for "procedure".
+ *
+ * @param procedureTerm the vendor term for "procedure"
+ */
+ void setProcedureTerm( String procedureTerm );
+
+ /**
+ * Retrieves the database vendor's preferred term for "catalog".
+ *
+ * @return the vendor term for "catalog"
+ */
+ String getCatalogTerm();
+
+ /**
+ * Sets the database vendor's preferred term for "catalog".
+ *
+ * @param catalogTerm the vendor term for "catalog"
+ */
+ void setCatalogTerm( String catalogTerm );
+
+ /**
+ * Retrieves whether a catalog appears at the start of a fully qualified table name. If not, the catalog appears at the end.
+ *
+ * @return <code>true</code> if the catalog name appears at the beginning of a fully qualified table name; <code>false</code>
+ * otherwise
+ */
+ Boolean isCatalogAtStart();
+
+ /**
+ * Sets whether a catalog appears at the start of a fully qualified table name. If not, the catalog appears at the end.
+ *
+ * @param catalogAtStart <code>true</code> if the catalog name appears at the beginning of a fully qualified table name;
+ * <code>false</code> otherwise
+ */
+ void setCatalogAtStart( Boolean catalogAtStart );
+
+ /**
+ * Retrieves the <code>String</code> that this database uses as the separator between a catalog and table name.
+ *
+ * @return the separator string
+ */
+ String getCatalogSeparator();
+
+ /**
+ * Sets the <code>String</code> that this database uses as the separator between a catalog and table name.
+ *
+ * @param catalogSeparator the separator string
+ */
+ void setCatalogSeparator( String catalogSeparator );
+
+ /**
+ * Retrieves whether a schema name can be used in a data manipulation statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSchemasInDataManipulation();
+
+ /**
+ * Sets whether a schema name can be used in a data manipulation statement.
+ *
+ * @param supportsSchemasInDataManipulation <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSchemasInDataManipulation( Boolean supportsSchemasInDataManipulation );
+
+ /**
+ * Retrieves whether a schema name can be used in a procedure call statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSchemasInProcedureCalls();
+
+ /**
+ * Sets whether a schema name can be used in a procedure call statement.
+ *
+ * @param supportsSchemasInProcedureCalls <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSchemasInProcedureCalls( Boolean supportsSchemasInProcedureCalls );
+
+ /**
+ * Retrieves whether a schema name can be used in a table definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSchemasInTableDefinitions();
+
+ /**
+ * Sets whether a schema name can be used in a table definition statement.
+ *
+ * @param supportsSchemasInTableDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSchemasInTableDefinitions( Boolean supportsSchemasInTableDefinitions );
+
+ /**
+ * Retrieves whether a schema name can be used in an index definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSchemasInIndexDefinitions();
+
+ /**
+ * Sets whether a schema name can be used in an index definition statement.
+ *
+ * @param supportsSchemasInIndexDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSchemasInIndexDefinitions( Boolean supportsSchemasInIndexDefinitions );
+
+ /**
+ * Retrieves whether a schema name can be used in a privilege definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSchemasInPrivilegeDefinitions();
+
+ /**
+ * Sets whether a schema name can be used in a privilege definition statement.
+ *
+ * @param supportsSchemasInPrivilegeDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSchemasInPrivilegeDefinitions( Boolean supportsSchemasInPrivilegeDefinitions );
+
+ /**
+ * Retrieves whether a catalog name can be used in a data manipulation statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCatalogsInDataManipulation();
+
+ /**
+ * Sets whether a catalog name can be used in a data manipulation statement.
+ *
+ * @param supportsCatalogsInDataManipulation <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCatalogsInDataManipulation( Boolean supportsCatalogsInDataManipulation );
+
+ /**
+ * Retrieves whether a catalog name can be used in a procedure call statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCatalogsInProcedureCalls();
+
+ /**
+ * Sets whether a catalog name can be used in a procedure call statement.
+ *
+ * @param supportsCatalogsInProcedureCalls <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCatalogsInProcedureCalls( Boolean supportsCatalogsInProcedureCalls );
+
+ /**
+ * Retrieves whether a catalog name can be used in a table definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCatalogsInTableDefinitions();
+
+ /**
+ * Sets whether a catalog name can be used in a table definition statement.
+ *
+ * @param supportsCatalogsInTableDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCatalogsInTableDefinitions( Boolean supportsCatalogsInTableDefinitions );
+
+ /**
+ * Retrieves whether a catalog name can be used in an index definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @exception SQLException if a database access error occurs
+ */
+ Boolean isSupportsCatalogsInIndexDefinitions();
+
+ /**
+ * Sets whether a catalog name can be used in an index definition statement.
+ *
+ * @param supportsCatalogsInIndexDefinitions <code>true</code> if so; <code>false</code> otherwise
+ * @exception SQLException if a database access error occurs
+ */
+ void setSupportsCatalogsInIndexDefinitions( Boolean supportsCatalogsInIndexDefinitions );
+
+ /**
+ * Retrieves whether a catalog name can be used in a privilege definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCatalogsInPrivilegeDefinitions();
+
+ /**
+ * Sets whether a catalog name can be used in a privilege definition statement.
+ *
+ * @param supportsCatalogsInPrivilegeDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCatalogsInPrivilegeDefinitions( Boolean supportsCatalogsInPrivilegeDefinitions );
+
+ /**
+ * Retrieves whether this database supports positioned <code>DELETE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsPositionedDelete();
+
+ /**
+ * Sets whether this database supports positioned <code>DELETE</code> statements.
+ *
+ * @param supportsPositionedDelete <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsPositionedDelete( Boolean supportsPositionedDelete );
+
+ /**
+ * Retrieves whether this database supports positioned <code>UPDATE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsPositionedUpdate();
+
+ /**
+ * Sets whether this database supports positioned <code>UPDATE</code> statements.
+ *
+ * @param supportsPositionedUpdate <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsPositionedUpdate( Boolean supportsPositionedUpdate );
+
+ /**
+ * Retrieves whether this database supports <code>SELECT FOR UPDATE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSelectForUpdate();
+
+ /**
+ * Sets whether this database supports <code>SELECT FOR UPDATE</code> statements.
+ *
+ * @param supportsSelectForUpdate <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSelectForUpdate( Boolean supportsSelectForUpdate );
+
+ /**
+ * Retrieves whether this database supports stored procedure calls that use the stored procedure escape syntax.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsStoredProcedures();
+
+ /**
+ * Sets whether this database supports stored procedure calls that use the stored procedure escape syntax.
+ *
+ * @param supportsStoredProcedures <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsStoredProcedures( Boolean supportsStoredProcedures );
+
+ /**
+ * Retrieves whether this database supports subqueries in comparison expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSubqueriesInComparisons();
+
+ /**
+ * Retrieves whether this database supports subqueries in comparison expressions.
+ *
+ * @param supportsSubqueriesInComparisons <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSubqueriesInComparisons( Boolean supportsSubqueriesInComparisons );
+
+ /**
+ * Retrieves whether this database supports subqueries in <code>EXISTS</code> expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSubqueriesInExists();
+
+ /**
+ * Sets whether this database supports subqueries in <code>EXISTS</code> expressions.
+ *
+ * @param supportsSubqueriesInExists <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSubqueriesInExists( Boolean supportsSubqueriesInExists );
+
+ /**
+ * Retrieves whether this database supports subqueries in <code>IN</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSubqueriesInIns();
+
+ /**
+ * Sets whether this database supports subqueries in <code>IN</code> statements.
+ *
+ * @param supportsSubqueriesInIns <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSubqueriesInIns( Boolean supportsSubqueriesInIns );
+
+ /**
+ * Retrieves whether this database supports subqueries in quantified expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsSubqueriesInQuantifieds();
+
+ /**
+ * Sets whether this database supports subqueries in quantified expressions.
+ *
+ * @param supportsSubqueriesInQuantifieds <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsSubqueriesInQuantifieds( Boolean supportsSubqueriesInQuantifieds );
+
+ /**
+ * Retrieves whether this database supports correlated subqueries.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsCorrelatedSubqueries();
+
+ /**
+ * Sets whether this database supports correlated subqueries.
+ *
+ * @param supportsCorrelatedSubqueries <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsCorrelatedSubqueries( Boolean supportsCorrelatedSubqueries );
+
+ /**
+ * Retrieves whether this database supports SQL <code>UNION</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsUnion();
+
+ /**
+ * Sets whether this database supports SQL <code>UNION</code>.
+ *
+ * @param supportsUnion <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsUnion( Boolean supportsUnion );
+
+ /**
+ * Retrieves whether this database supports SQL <code>UNION ALL</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsUnionAll();
+
+ /**
+ * Sets whether this database supports SQL <code>UNION ALL</code>.
+ *
+ * @param supportsUnionAll <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsUnionAll( Boolean supportsUnionAll );
+
+ /**
+ * Retrieves whether this database supports keeping cursors open across commits.
+ *
+ * @return <code>true</code> if cursors always remain open; <code>false</code> if they might not remain open
+ */
+ Boolean isSupportsOpenCursorsAcrossCommit();
+
+ /**
+ * Sets whether this database supports keeping cursors open across commits.
+ *
+ * @param supportsOpenCursorsAcrossCommit <code>true</code> if cursors always remain open; <code>false</code> if they might
+ * not remain open
+ */
+ void setSupportsOpenCursorsAcrossCommit( Boolean supportsOpenCursorsAcrossCommit );
+
+ /**
+ * Retrieves whether this database supports keeping cursors open across rollbacks.
+ *
+ * @return <code>true</code> if cursors always remain open; <code>false</code> if they might not remain open
+ */
+ Boolean isSupportsOpenCursorsAcrossRollback();
+
+ /**
+ * Sets whether this database supports keeping cursors open across rollbacks.
+ *
+ * @param supportsOpenCursorsAcrossRollback <code>true</code> if cursors always remain open; <code>false</code> if they might
+ * not remain open
+ */
+ void setSupportsOpenCursorsAcrossRollback( Boolean supportsOpenCursorsAcrossRollback );
+
+ /**
+ * Retrieves whether this database supports keeping statements open across commits.
+ *
+ * @return <code>true</code> if statements always remain open; <code>false</code> if they might not remain open
+ */
+ Boolean isSupportsOpenStatementsAcrossCommit();
+
+ /**
+ * sets whether this database supports keeping statements open across commits.
+ *
+ * @param supportsOpenStatementsAcrossCommit <code>true</code> if statements always remain open; <code>false</code> if they
+ * might not remain open
+ */
+ void setSupportsOpenStatementsAcrossCommit( Boolean supportsOpenStatementsAcrossCommit );
+
+ /**
+ * Retrieves whether this database supports keeping statements open across rollbacks.
+ *
+ * @return <code>true</code> if statements always remain open; <code>false</code> if they might not remain open
+ */
+ Boolean isSupportsOpenStatementsAcrossRollback();
+
+ /**
+ * Sets whether this database supports keeping statements open across rollbacks.
+ *
+ * @param supportsOpenStatementsAcrossRollback <code>true</code> if statements always remain open; <code>false</code> if they
+ * might not remain open
+ */
+ void setSupportsOpenStatementsAcrossRollback( Boolean supportsOpenStatementsAcrossRollback );
+
+ // ----------------------------------------------------------------------
+ // The following group of methods exposes various limitations based on the target
+ // database with the current driver. Unless otherwise specified, a result of zero
+ // means there is no limit, or the limit is not known.
+ // ----------------------------------------------------------------------
+
+ /**
+ * Retrieves the maximum number of hex characters this database allows in an inline binary literal.
+ *
+ * @return max the maximum length (in hex characters) for a binary literal; a result of zero means that there is no limit or
+ * the limit is not known
+ */
+ Integer getMaxBinaryLiteralLength();
+
+ /**
+ * sets the maximum number of hex characters this database allows in an inline binary literal.
+ *
+ * @param maxBinaryLiteralLength max the maximum length (in hex characters) for a binary literal; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ void setMaxBinaryLiteralLength( Integer maxBinaryLiteralLength );
+
+ /**
+ * Retrieves the maximum number of characters this database allows for a character literal.
+ *
+ * @return the maximum number of characters allowed for a character literal; a result of zero means that there is no limit or
+ * the limit is not known
+ */
+ Integer getMaxCharLiteralLength();
+
+ /**
+ * Sets the maximum number of characters this database allows for a character literal.
+ *
+ * @param maxCharLiteralLength the maximum number of characters allowed for a character literal; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ void setMaxCharLiteralLength( Integer maxCharLiteralLength );
+
+ /**
+ * Retrieves the maximum number of characters this database allows for a column name.
+ *
+ * @return the maximum number of characters allowed for a column name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxColumnNameLength();
+
+ /**
+ * Sets the maximum number of characters this database allows for a column name.
+ *
+ * @param maxColumnNameLength the maximum number of characters allowed for a column name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ void setMaxColumnNameLength( Integer maxColumnNameLength );
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a <code>GROUP BY</code> clause.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxColumnsInGroupBy();
+
+ /**
+ * Sets the maximum number of columns this database allows in a <code>GROUP BY</code> clause.
+ *
+ * @param maxColumnsInGroupBy the maximum number of columns allowed; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ void setMaxColumnsInGroupBy( Integer maxColumnsInGroupBy );
+
+ /**
+ * Retrieves the maximum number of columns this database allows in an index.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxColumnsInIndex();
+
+ /**
+ * Sets the maximum number of columns this database allows in an index.
+ *
+ * @param maxColumnsInIndex the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ void setMaxColumnsInIndex( Integer maxColumnsInIndex );
+
+ /**
+ * Retrieves the maximum number of columns this database allows in an <code>ORDER BY</code> clause.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxColumnsInOrderBy();
+
+ /**
+ * Sets the maximum number of columns this database allows in an <code>ORDER BY</code> clause.
+ *
+ * @param maxColumnsInOrderBy the maximum number of columns allowed; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ void setMaxColumnsInOrderBy( Integer maxColumnsInOrderBy );
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a <code>SELECT</code> list.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxColumnsInSelect();
+
+ /**
+ * Sets the maximum number of columns this database allows in a <code>SELECT</code> list.
+ *
+ * @param maxColumnsInSelect the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ void setMaxColumnsInSelect( Integer maxColumnsInSelect );
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a table.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxColumnsInTable();
+
+ /**
+ * Sets the maximum number of columns this database allows in a table.
+ *
+ * @param maxColumnsInTable the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ void setMaxColumnsInTable( Integer maxColumnsInTable );
+
+ /**
+ * Retrieves the maximum number of concurrent connections to this database that are possible.
+ *
+ * @return the maximum number of active connections possible at one time; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxConnections();
+
+ /**
+ * Sets the maximum number of concurrent connections to this database that are possible.
+ *
+ * @param maxConnections the maximum number of active connections possible at one time; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ void setMaxConnections( Integer maxConnections );
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a cursor name.
+ *
+ * @return the maximum number of characters allowed in a cursor name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxCursorNameLength();
+
+ /**
+ * Sets the maximum number of characters that this database allows in a cursor name.
+ *
+ * @param maxCursorNameLength the maximum number of characters allowed in a cursor name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ void setMaxCursorNameLength( Integer maxCursorNameLength );
+
+ /**
+ * Retrieves the maximum number of bytes this database allows for an index, including all of the parts of the index.
+ *
+ * @return the maximum number of bytes allowed; this limit includes the composite of all the constituent parts of the index; a
+ * result of zero means that there is no limit or the limit is not known
+ */
+ Integer getMaxIndexLength();
+
+ /**
+ * Sets the maximum number of bytes this database allows for an index, including all of the parts of the index.
+ *
+ * @param maxIndexLength the maximum number of bytes allowed; this limit includes the composite of all the constituent parts
+ * of the index; a result of zero means that there is no limit or the limit is not known
+ */
+ void setMaxIndexLength( Integer maxIndexLength );
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a schema name.
+ *
+ * @return the maximum number of characters allowed in a schema name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxSchemaNameLength();
+
+ /**
+ * Sets the maximum number of characters that this database allows in a schema name.
+ *
+ * @param maxSchemaNameLength the maximum number of characters allowed in a schema name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ void setMaxSchemaNameLength( Integer maxSchemaNameLength );
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a procedure name.
+ *
+ * @return the maximum number of characters allowed in a procedure name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxProcedureNameLength();
+
+ /**
+ * Sets the maximum number of characters that this database allows in a procedure name.
+ *
+ * @param maxProcedureNameLength the maximum number of characters allowed in a procedure name; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ void setMaxProcedureNameLength( Integer maxProcedureNameLength );
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a catalog name.
+ *
+ * @return the maximum number of characters allowed in a catalog name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxCatalogNameLength();
+
+ /**
+ * Sets the maximum number of characters that this database allows in a catalog name.
+ *
+ * @param maxCatalogNameLength the maximum number of characters allowed in a catalog name; a result of zero means that there
+ * is no limit or the limit is not known
+ */
+ void setMaxCatalogNameLength( Integer maxCatalogNameLength );
+
+ /**
+ * Retrieves the maximum number of bytes this database allows in a single row.
+ *
+ * @return the maximum number of bytes allowed for a row; a result of zero means that there is no limit or the limit is not
+ * known
+ */
+ Integer getMaxRowSize();
+
+ /**
+ * Sets the maximum number of bytes this database allows in a single row.
+ *
+ * @param maxRowSize the maximum number of bytes allowed for a row; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ void setMaxRowSize( Integer maxRowSize );
+
+ /**
+ * Retrieves whether the return value for the method <code>getMaxRowSize</code> includes the SQL data types
+ * <code>LONGVARCHAR</code> and <code>LONGVARBINARY</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isMaxRowSizeIncludeBlobs();
+
+ /**
+ * Sets whether the return value for the method <code>getMaxRowSize</code> includes the SQL data types
+ * <code>LONGVARCHAR</code> and <code>LONGVARBINARY</code>.
+ *
+ * @param maxRowSizeIncludeBlobs <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setMaxRowSizeIncludeBlobs( Boolean maxRowSizeIncludeBlobs );
+
+ /**
+ * Retrieves the maximum number of characters this database allows in an SQL statement.
+ *
+ * @return the maximum number of characters allowed for an SQL statement; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxStatementLength();
+
+ /**
+ * Sets the maximum number of characters this database allows in an SQL statement.
+ *
+ * @param maxStatementLength the maximum number of characters allowed for an SQL statement; a result of zero means that there
+ * is no limit or the limit is not known
+ */
+ void setMaxStatementLength( Integer maxStatementLength );
+
+ /**
+ * Retrieves the maximum number of active statements to this database that can be open at the same time.
+ *
+ * @return the maximum number of statements that can be open at one time; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxStatements();
+
+ /**
+ * Sets the maximum number of active statements to this database that can be open at the same time.
+ *
+ * @param maxStatements the maximum number of statements that can be open at one time; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ void setMaxStatements( Integer maxStatements );
+
+ /**
+ * Retrieves the maximum number of characters this database allows in a table name.
+ *
+ * @return the maximum number of characters allowed for a table name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxTableNameLength();
+
+ /**
+ * Sets the maximum number of characters this database allows in a table name.
+ *
+ * @param maxTableNameLength the maximum number of characters allowed for a table name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ void setMaxTableNameLength( Integer maxTableNameLength );
+
+ /**
+ * Retrieves the maximum number of tables this database allows in a <code>SELECT</code> statement.
+ *
+ * @return the maximum number of tables allowed in a <code>SELECT</code> statement; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ Integer getMaxTablesInSelect();
+
+ /**
+ * Sets the maximum number of tables this database allows in a <code>SELECT</code> statement.
+ *
+ * @param maxTablesInSelect the maximum number of tables allowed in a <code>SELECT</code> statement; a result of zero means
+ * that there is no limit or the limit is not known
+ */
+ void setMaxTablesInSelect( Integer maxTablesInSelect );
+
+ /**
+ * Retrieves the maximum number of characters this database allows in a user name.
+ *
+ * @return the maximum number of characters allowed for a user name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ Integer getMaxUserNameLength();
+
+ /**
+ * Sets the maximum number of characters this database allows in a user name.
+ *
+ * @param maxUserNameLength the maximum number of characters allowed for a user name; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ void setMaxUserNameLength( Integer maxUserNameLength );
+
+ /**
+ * Retrieves this database's default transaction isolation level. The possible values are defined in
+ * <code>java.sql.Connection</code>.
+ *
+ * @return the default isolation level
+ * @see Connection
+ */
+ Integer getDefaultTransactionIsolation();
+
+ /**
+ * Sets this database's default transaction isolation level. The possible values are defined in
+ * <code>java.sql.Connection</code>.
+ *
+ * @param defaultTransactionIsolation the default isolation level
+ * @see Connection
+ */
+ void setDefaultTransactionIsolation( Integer defaultTransactionIsolation );
+
+ /**
+ * Retrieves whether this database supports transactions. If not, invoking the method <code>commit</code> is a noop, and the
+ * isolation level is <code>TRANSACTION_NONE</code>.
+ *
+ * @return <code>true</code> if transactions are supported; <code>false</code> otherwise
+ */
+ Boolean isSupportsTransactions();
+
+ /**
+ * Sets whether this database supports transactions. If not, invoking the method <code>commit</code> is a noop, and the
+ * isolation level is <code>TRANSACTION_NONE</code>.
+ *
+ * @param supportsTransactions <code>true</code> if transactions are supported; <code>false</code> otherwise
+ */
+ void setSupportsTransactions( Boolean supportsTransactions );
+
+ /**
+ * Retrieves list of database supported transaction isolation levels.
+ *
+ * @return list of database supported transaction isolation levels.
+ * @see Connection
+ */
+ Set<TransactionIsolationLevelType> getSupportedTransactionIsolationLevels();
+
+ /**
+ * Adds TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ */
+ void addSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType );
+
+ /**
+ * Deletes TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ */
+ void deleteSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType );
+
+ /**
+ * Is supported TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ */
+ Boolean isSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType );
+
+ /**
+ * Retrieves whether this database supports both data definition and data manipulation statements within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsDataDefinitionAndDataManipulationTransactions();
+
+ /**
+ * Sets whether this database supports both data definition and data manipulation statements within a transaction.
+ *
+ * @param supportsDataDefinitionAndDataManipulationTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsDataDefinitionAndDataManipulationTransactions( Boolean supportsDataDefinitionAndDataManipulationTransactions );
+
+ /**
+ * Retrieves whether this database supports only data manipulation statements within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isSupportsDataManipulationTransactionsOnly();
+
+ /**
+ * Sets whether this database supports only data manipulation statements within a transaction.
+ *
+ * @param supportsDataManipulationTransactionsOnly <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setSupportsDataManipulationTransactionsOnly( Boolean supportsDataManipulationTransactionsOnly );
+
+ /**
+ * Retrieves whether a data definition statement within a transaction forces the transaction to commit.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isDataDefinitionCausesTransactionCommit();
+
+ /**
+ * Sets whether a data definition statement within a transaction forces the transaction to commit.
+ *
+ * @param dataDefinitionCausesTransactionCommit <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setDataDefinitionCausesTransactionCommit( Boolean dataDefinitionCausesTransactionCommit );
+
+ /**
+ * Retrieves whether this database ignores a data definition statement within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ Boolean isDataDefinitionIgnoredInTransactions();
+
+ /**
+ * Sets whether this database ignores a data definition statement within a transaction.
+ *
+ * @param dataDefinitionIgnoredInTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ void setDataDefinitionIgnoredInTransactions( Boolean dataDefinitionIgnoredInTransactions );
+
+ /**
+ * Retrieves a description of the stored procedures available in the given catalog.
+ *
+ * @return a set of stored procedures available
+ */
+ Set<StoredProcedure> getStoredProcedures();
+
+ /**
+ * Adds Stored Procedure
+ *
+ * @param storedProcedure the Stored Procedure
+ */
+ void addStoredProcedure( StoredProcedure storedProcedure );
+
+ /**
+ * Deletes Stored Procedure
+ *
+ * @param storedProcedure the Stored Procedure
+ */
+ void deleteStoredProcedure( StoredProcedure storedProcedure );
+
+ /**
+ * Finds stored procedute by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param procedureName a procedure name; must match the procedure name as it is stored in the database
+ * @return stored procedure or null if not found
+ */
+ StoredProcedure findStoredProcedureByName( String catalog,
+ String schema,
+ String procedureName );
+
+ /**
+ * Retrieves a description of the tables available in the given catalog.
+ *
+ * @return a set of tables available
+ */
+ Set<Table> getTables();
+
+ /**
+ * Adds Table
+ *
+ * @param table the table to add
+ */
+ void addTable( Table table );
+
+ /**
+ * Deletes Table
+ *
+ * @param table the table to delete
+ */
+ void deleteTable( Table table );
+
+ /**
+ * Finds table by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param tableName a table name; must match the table name as it is stored in the database
+ * @return table or null if not found
+ */
+ Table findTableByName( String catalog,
+ String schema,
+ String tableName );
+
+ /**
+ * Retrieves the schemas available in this database. The results are ordered by schema name.
+ *
+ * @return schemas available in this database.
+ */
+ Set<Schema> getSchemas();
+
+ /**
+ * Adds Schema
+ *
+ * @param schema the Schema
+ */
+ void addSchema( Schema schema );
+
+ /**
+ * Deletes Schema
+ *
+ * @param schema the Schema
+ */
+ void deleteSchema( Schema schema );
+
+ /**
+ * Finds schema by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schemaName a schema name; must match the schema name as it is stored in the database;
+ * @return schema or null if not found
+ */
+ Schema findSchemaByName( String catalog,
+ String schemaName );
+
+ /**
+ * Retrieves the catalogs available in this database
+ *
+ * @return catalogs available in this database
+ */
+ Set<Catalog> getCatalogs();
+
+ /**
+ * Adds Catalog
+ *
+ * @param catalog the catalog to add
+ */
+ void addCatalog( Catalog catalog );
+
+ /**
+ * Deletes Catalog
+ *
+ * @param catalog the catalog to delete
+ */
+ void deleteCatalog( Catalog catalog );
+
+ /**
+ * Finds catalog by its name.
+ *
+ * @param catalogName a catalog name; must match the catalog name as it is stored in the database;
+ * @return catalog or null if not found
+ */
+ Catalog findCatalogByName( String catalogName );
+
+ /**
+ * Retrieves the table types available in this database. The results are ordered by table type.
+ * <P>
+ * The table type is:
+ * <OL>
+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ * </OL>
+ *
+ * @return table types available in this database
+ */
+ Set<TableType> getTableTypes();
+
+ /**
+ * Adds TableType
+ *
+ * @param tableType the table type to add
+ */
+ void addTableType( TableType tableType );
+
+ /**
+ * Deletes TableType
+ *
+ * @param tableType the table type to delete
+ */
+ void deleteTableType( TableType tableType );
+
+ /**
+ * Finds table type by its name.
+ *
+ * @param typeName a table type name; must match the type name as it is stored in the database;
+ * @return table type or null if not found
+ */
+ TableType findTableTypeByTypeName( String typeName );
+
+ /**
+ * Retrieves a description of all the standard SQL types supported by this database
+ *
+ * @return all the standard SQL types supported by this database
+ */
+ Set<SqlTypeInfo> getSqlTypeInfos();
+
+ /**
+ * Adds SqlTypeInfo
+ *
+ * @param sqlTypeInfo the SQL type to add
+ */
+ void addSqlTypeInfo( SqlTypeInfo sqlTypeInfo );
+
+ /**
+ * Deletes SqlTypeInfo
+ *
+ * @param sqlTypeInfo the SQL type to delete
+ */
+ void deleteSqlTypeInfo( SqlTypeInfo sqlTypeInfo );
+
+ /**
+ * Finds SQL type by its name.
+ *
+ * @param typeName a table type name; must match the type name as it is stored in the database;
+ * @return table type or null if not found
+ */
+ SqlTypeInfo findSqlTypeInfoByTypeName( String typeName );
+
+ // ===============================================================
+ // --------------------------JDBC 2.0-----------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves database supported result set types.
+ *
+ * @return database supported result set types.
+ * @see Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ Set<ResultSetType> getSupportedResultSetTypes();
+
+ /**
+ * Adds supported ResultSetType
+ *
+ * @param resultSetType the ResultSetType
+ */
+ void addSupportedResultSetType( ResultSetType resultSetType );
+
+ /**
+ * Deletes supported ResultSetType
+ *
+ * @param resultSetType the ResultSetType
+ */
+ void deleteSupportedResultSetType( ResultSetType resultSetType );
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ Set<ResultSetConcurrencyType> getSupportedForwardOnlyResultSetConcurrencies();
+
+ /**
+ * Adds ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void addSupportedForwardOnlyResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * Deletes ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void deleteSupportedForwardOnlyResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ Set<ResultSetConcurrencyType> getSupportedScrollInsensitiveResultSetConcurrencies();
+
+ /**
+ * Adds ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void addSupportedScrollInsensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * Delete ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void deleteSupportedScrollInsensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ Set<ResultSetConcurrencyType> getSupportedScrollSensitiveResultSetConcurrencies();
+
+ /**
+ * Adds resultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void addSupportedScrollSensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * delete resultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ void deleteSupportedScrollSensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType );
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOwnUpdatesAreVisible();
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param forwardOnlyResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOwnUpdatesAreVisible( Boolean forwardOnlyResultSetOwnUpdatesAreVisible );
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOwnUpdatesAreVisible();
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOwnUpdatesAreVisible( Boolean scrollInsensitiveResultSetOwnUpdatesAreVisible );
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOwnUpdatesAreVisible();
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param scrollSensitiveResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOwnUpdatesAreVisible( Boolean scrollSensitiveResultSetOwnUpdatesAreVisible );
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOwnDeletesAreVisible();
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param forwardOnlyResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOwnDeletesAreVisible( Boolean forwardOnlyResultSetOwnDeletesAreVisible );
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOwnDeletesAreVisible();
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOwnDeletesAreVisible( Boolean scrollInsensitiveResultSetOwnDeletesAreVisible );
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOwnDeletesAreVisible();
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param scrollSensitiveResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOwnDeletesAreVisible( Boolean scrollSensitiveResultSetOwnDeletesAreVisible );
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOwnInsertsAreVisible();
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param forwardOnlyResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOwnInsertsAreVisible( Boolean forwardOnlyResultSetOwnInsertsAreVisible );
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOwnInsertsAreVisible();
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOwnInsertsAreVisible( Boolean scrollInsensitiveResultSetOwnInsertsAreVisible );
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOwnInsertsAreVisible();
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param scrollSensitiveResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOwnInsertsAreVisible( Boolean scrollSensitiveResultSetOwnInsertsAreVisible );
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOthersUpdatesAreVisible();
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOthersUpdatesAreVisible( Boolean forwardOnlyResultSetOthersUpdatesAreVisible );
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOthersUpdatesAreVisible();
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOthersUpdatesAreVisible( Boolean scrollInsensitiveResultSetOthersUpdatesAreVisible );
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOthersUpdatesAreVisible();
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOthersUpdatesAreVisible( Boolean scrollSensitiveResultSetOthersUpdatesAreVisible );
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOthersDeletesAreVisible();
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOthersDeletesAreVisible( Boolean forwardOnlyResultSetOthersDeletesAreVisible );
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOthersDeletesAreVisible();
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOthersDeletesAreVisible( Boolean scrollInsensitiveResultSetOthersDeletesAreVisible );
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOthersDeletesAreVisible();
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOthersDeletesAreVisible( Boolean scrollSensitiveResultSetOthersDeletesAreVisible );
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetOthersInsertsAreVisible();
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetOthersInsertsAreVisible( Boolean forwardOnlyResultSetOthersInsertsAreVisible );
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetOthersInsertsAreVisible();
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetOthersInsertsAreVisible( Boolean scrollInsensitiveResultSetOthersInsertsAreVisible );
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetOthersInsertsAreVisible();
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetOthersInsertsAreVisible( Boolean scrollSensitiveResultSetOthersInsertsAreVisible );
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetUpdatesAreDetected();
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param forwardOnlyResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetUpdatesAreDetected( Boolean forwardOnlyResultSetUpdatesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetUpdatesAreDetected();
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param scrollInsensitiveResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetUpdatesAreDetected( Boolean scrollInsensitiveResultSetUpdatesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetUpdatesAreDetected();
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param scrollSensitiveResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetUpdatesAreDetected( Boolean scrollSensitiveResultSetUpdatesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultSetDeletesAreDetected();
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param forwardOnlyResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultSetDeletesAreDetected( Boolean forwardOnlyResultSetDeletesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultSetDeletesAreDetected();
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param scrollInsensitiveResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultSetDeletesAreDetected( Boolean scrollInsensitiveResultSetDeletesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultSetDeletesAreDetected();
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param scrollSensitiveResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultSetDeletesAreDetected( Boolean scrollSensitiveResultSetDeletesAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isForwardOnlyResultInsertsAreDetected();
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param forwardOnlyResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setForwardOnlyResultInsertsAreDetected( Boolean forwardOnlyResultInsertsAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollInsensitiveResultInsertsAreDetected();
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param scrollInsensitiveResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollInsensitiveResultInsertsAreDetected( Boolean scrollInsensitiveResultInsertsAreDetected );
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isScrollSensitiveResultInsertsAreDetected();
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param scrollSensitiveResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setScrollSensitiveResultInsertsAreDetected( Boolean scrollSensitiveResultInsertsAreDetected );
+
+ /**
+ * Retrieves whether this database supports batch updates.
+ *
+ * @return <code>true</code> if this database supports batch upcates; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ Boolean isSupportsBatchUpdates();
+
+ /**
+ * Sets whether this database supports batch updates.
+ *
+ * @param supportsBatchUpdates <code>true</code> if this database supports batch upcates; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ void setSupportsBatchUpdates( Boolean supportsBatchUpdates );
+
+ /**
+ * Retrieves a description of the UDT available in the given catalog.
+ *
+ * @return a set of UDT available
+ */
+ Set<UserDefinedType> getUserDefinedTypes();
+
+ /**
+ * Adds UDT
+ *
+ * @param udt the UDT to add
+ */
+ void addUserDefinedType( UserDefinedType udt );
+
+ /**
+ * Deletes UDT
+ *
+ * @param udt the UDT to delete
+ */
+ void deleteUserDefinedType( UserDefinedType udt );
+
+ /**
+ * Finds UDT by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param tableName a table name; must match the table name as it is stored in the database
+ * @return table or null if not found
+ */
+ UserDefinedType findUserDefinedTypeByName( String catalog,
+ String schema,
+ String tableName );
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves whether this database supports savepoints.
+ *
+ * @return <code>true</code> if savepoints are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsSavepoints();
+
+ /**
+ * Sets whether this database supports savepoints.
+ *
+ * @param supportsSavepoints <code>true</code> if savepoints are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsSavepoints( Boolean supportsSavepoints );
+
+ /**
+ * Retrieves whether this database supports named parameters to callable statements.
+ *
+ * @return <code>true</code> if named parameters are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsNamedParameters();
+
+ /**
+ * Sets whether this database supports named parameters to callable statements.
+ *
+ * @param supportsNamedParameters <code>true</code> if named parameters are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsNamedParameters( Boolean supportsNamedParameters );
+
+ /**
+ * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects returned from a
+ * <code>CallableStatement</code> object simultaneously.
+ *
+ * @return <code>true</code> if a <code>CallableStatement</code> object can return multiple <code>ResultSet</code> objects
+ * simultaneously; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsMultipleOpenResults();
+
+ /**
+ * Sets whether it is possible to have multiple <code>ResultSet</code> objects returned from a <code>CallableStatement</code>
+ * object simultaneously.
+ *
+ * @param supportsMultipleOpenResults <code>true</code> if a <code>CallableStatement</code> object can return multiple
+ * <code>ResultSet</code> objects simultaneously; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsMultipleOpenResults( Boolean supportsMultipleOpenResults );
+
+ /**
+ * Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
+ *
+ * @return <code>true</code> if auto-generated keys can be retrieved after a statement has executed; <code>false</code>
+ * otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsGetGeneratedKeys();
+
+ /**
+ * Sets whether auto-generated keys can be retrieved after a statement has been executed.
+ *
+ * @param supportsGetGeneratedKeys <code>true</code> if auto-generated keys can be retrieved after a statement has executed;
+ * <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsGetGeneratedKeys( Boolean supportsGetGeneratedKeys );
+
+ /**
+ * Retrieves whether this database supports the given result set holdability.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @see Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsResultSetHoldCurrorsOverCommitHoldability();
+
+ /**
+ * Sets whether this database supports the given result set holdability.
+ *
+ * @param supportsResultSetHoldCurrorsOverCommitHoldability <code>true</code> if so; <code>false</code> otherwise
+ * @see Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsResultSetHoldCurrorsOverCommitHoldability( Boolean supportsResultSetHoldCurrorsOverCommitHoldability );
+
+ /**
+ * Retrieves whether this database supports the given result set holdability.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @see Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsResultSetCloseCurrorsAtCommitHoldability();
+
+ /**
+ * Sets whether this database supports the given result set holdability.
+ *
+ * @param supportsResultSetCloseCurrorsAtCommitHoldability <code>true</code> if so; <code>false</code> otherwise
+ * @see Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsResultSetCloseCurrorsAtCommitHoldability( Boolean supportsResultSetCloseCurrorsAtCommitHoldability );
+
+ /**
+ * Retrieves the default holdability of this <code>ResultSet</code> object.
+ *
+ * @return the default holdability; either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
+ * @exception SQLException if a database access error occurs
+ * @since 1.4
+ */
+ ResultSetHoldabilityType getResultSetHoldabilityType();
+
+ /**
+ * Sets the default holdability of this <code>ResultSet</code> object.
+ *
+ * @param resultSetHoldabilityType the ResultSetHoldabilityType
+ * @return the default holdability; either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
+ * @exception SQLException if a database access error occurs
+ * @since 1.4
+ */
+ void setResultSetHoldabilityType( ResultSetHoldabilityType resultSetHoldabilityType );
+
+ /**
+ * Retrieves the major version number of the underlying database.
+ *
+ * @return the underlying database's major version
+ * @since 1.4 (JDBC 3.0)
+ */
+ Integer getDatabaseMajorVersion();
+
+ /**
+ * Sets the major version number of the underlying database.
+ *
+ * @param databaseMajorVersion the underlying database's major version
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setDatabaseMajorVersion( Integer databaseMajorVersion );
+
+ /**
+ * Retrieves the minor version number of the underlying database.
+ *
+ * @return underlying database's minor version
+ * @since 1.4 (JDBC 3.0)
+ */
+ Integer getDatabaseMinorVersion();
+
+ /**
+ * Sets the minor version number of the underlying database.
+ *
+ * @param databaseMinorVersion underlying database's minor version
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setDatabaseMinorVersion( Integer databaseMinorVersion );
+
+ /**
+ * Retrieves the major JDBC version number for this driver.
+ *
+ * @return JDBC version major number
+ * @since 1.4 (JDBC 3.0)
+ */
+ Integer getJDBCMajorVersion();
+
+ /**
+ * Sets the major JDBC version number for this driver.
+ *
+ * @param jdbcMajorVersion JDBC version major number
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setJDBCMajorVersion( Integer jdbcMajorVersion );
+
+ /**
+ * Retrieves the minor JDBC version number for this driver.
+ *
+ * @return JDBC version minor number
+ * @since 1.4 (JDBC 3.0)
+ */
+ Integer getJDBCMinorVersion();
+
+ /**
+ * Sets the minor JDBC version number for this driver.
+ *
+ * @param jdbcMinorVersion JDBC version minor number
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setJDBCMinorVersion( Integer jdbcMinorVersion );
+
+ /**
+ * Indicates whether the SQLSTATE returned by <code>SQLException.getSQLState</code> is X/Open (now known as Open Group) SQL
+ * CLI or SQL99.
+ *
+ * @return the type of SQLSTATE; one of: sqlStateXOpen or sqlStateSQL99
+ * @since 1.4 (JDBC 3.0)
+ */
+ SQLStateType getSQLStateType();
+
+ /**
+ * Indicates whether the SQLSTATE returned by <code>SQLException.getSQLState</code> is X/Open (now known as Open Group) SQL
+ * CLI or SQL99.
+ *
+ * @param sqlStateType the type of SQLSTATE; one of: sqlStateXOpen or sqlStateSQL99
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSQLStateType( SQLStateType sqlStateType );
+
+ /**
+ * Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
+ *
+ * @return <code>true</code> if updates are made to a copy of the LOB; <code>false</code> if updates are made directly to the
+ * LOB
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isLocatorsUpdateCopy();
+
+ /**
+ * Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
+ *
+ * @param locatorsUpdateCopy <code>true</code> if updates are made to a copy of the LOB; <code>false</code> if updates are
+ * made directly to the LOB
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setLocatorsUpdateCopy( Boolean locatorsUpdateCopy );
+
+ /**
+ * Retrieves whether this database supports statement pooling.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ Boolean isSupportsStatementPooling();
+
+ /**
+ * Sets whether this database supports statement pooling.
+ *
+ * @param supportsStatementPooling <code>true</code> if so; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSupportsStatementPooling( Boolean supportsStatementPooling );
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseMetaDataMethodException.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseMetaDataMethodException.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseMetaDataMethodException.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Database metadata method call related exception
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseMetaDataMethodException extends Exception {
+ // ~ Instance fields ------------------------------------------------------------------
+ private static final long serialVersionUID = 5001714254060693493L;
+
+ public static final String METHOD_FAILED = "Database Metadata method failed";
+
+ /* database metadata method name that caused exception */
+ private String methodName;
+
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Default constructor
+ */
+ public DatabaseMetaDataMethodException() {
+ this(METHOD_FAILED, null, null);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param message the explanation of exception
+ * @param methodName the name of method that caused exception
+ */
+ public DatabaseMetaDataMethodException( String message,
+ String methodName ) {
+ this(message, methodName, null);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param message the explanation of exception
+ * @param methodName the name of method that caused exception
+ * @param ex the exception that causes problem
+ */
+ public DatabaseMetaDataMethodException( String message,
+ String methodName,
+ Throwable ex ) {
+ super(message, ex);
+
+ // set method name
+ setMethodName(methodName);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param ex the exception that causes problem
+ */
+ public DatabaseMetaDataMethodException( Throwable ex ) {
+ this(METHOD_FAILED, null, ex);
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Returns name of method that caused exception
+ *
+ * @return name of method that caused exception
+ */
+ public String getMethodName() {
+ return methodName;
+ }
+
+ /**
+ * Sets the name of method that caused exception
+ *
+ * @param methodName the name of method that caused exception
+ */
+ public void setMethodName( String methodName ) {
+ this.methodName = methodName;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseNamedObject.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseNamedObject.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/DatabaseNamedObject.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Map;
+
+/**
+ * Provides database named object specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface DatabaseNamedObject extends CoreMetaData {
+
+ /**
+ * Gets database named object name
+ *
+ * @return database named object name
+ */
+ String getName();
+
+ /**
+ * Sets database named object name
+ *
+ * @param name the database named object name
+ */
+ void setName( String name );
+
+ /**
+ * Gets explanatory comment on the database named object
+ *
+ * @return explanatory comment on the database named object
+ */
+ String getRemarks();
+
+ /**
+ * Sets explanatory comment on the database named object
+ *
+ * @param remarks the explanatory comment on the database named object
+ */
+ void setRemarks( String remarks );
+
+ /**
+ * Gets extra (non standard) properties if provided by database.
+ *
+ * @return extra properties if provided by database
+ */
+ Map<String, Object> getExtraProperties();
+
+ /**
+ * Gets extra (non standard) property if provided by database.
+ *
+ * @param key the key
+ * @return extra property if provided by database
+ */
+ Object getExtraProperty( String key );
+
+ /**
+ * Adds extra property
+ *
+ * @param key the key
+ * @param value the value
+ */
+ void addExtraProperty( String key,
+ Object value );
+
+ /**
+ * deletes extra property
+ *
+ * @param key the key
+ * @param value the value
+ */
+ void deleteExtraProperty( String key );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKey.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKey.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKey.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides database table's foreing key specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface ForeignKey extends SchemaObject {
+
+ /**
+ * Retrieves foreign key columns
+ *
+ * @return foreign key columns
+ */
+ Set<ForeignKeyColumn> getColumns();
+
+ /**
+ * Adds ForeignKeyColumn
+ *
+ * @param column the ForeignKeyColumn
+ */
+ void addColumn( ForeignKeyColumn column );
+
+ /**
+ * deletes ForeignKeyColumn
+ *
+ * @param column the ForeignKeyColumn
+ */
+ void deleteColumn( ForeignKeyColumn column );
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ ForeignKeyColumn findColumnByName( String columnName );
+
+ /**
+ * Returns the scope table of a foreign key.
+ *
+ * @return the scope table of a foreign key.
+ */
+ Table getSourceTable();
+
+ /**
+ * Sets the scope table of a foreign key.
+ *
+ * @param sourceTable the scope table of a foreign key.
+ */
+ void setSourceTable( Table sourceTable );
+
+ /**
+ * Returns the PK of scope table.
+ *
+ * @return the PK of scope table.
+ */
+ PrimaryKey getSourcePrimaryKey();
+
+ /**
+ * Sets the PK of scope table.
+ *
+ * @param primaryKey the PK of scope table.
+ */
+ void setSourcePrimaryKey( PrimaryKey primaryKey );
+
+ /**
+ * What happens to a foreign key when the primary key is updated
+ *
+ * @return what happens to a foreign key when the primary key is updated
+ */
+ KeyModifyRuleType getUpdateRule();
+
+ /**
+ * What happens to a foreign key when the primary key is updated
+ *
+ * @param keyModifyRuleType what happens to a foreign key when the primary key is updated
+ */
+ void setUpdateRule( KeyModifyRuleType updateRule );
+
+ /**
+ * What happens to a foreign key when the primary key is deleted
+ *
+ * @return what happens to a foreign key when the primary key is deleted
+ */
+ KeyModifyRuleType getDeleteRule();
+
+ /**
+ * What happens to a foreign key when the primary key is deleted
+ *
+ * @param deleteRule what happens to a foreign key when the primary key is deleted
+ */
+ void setDeleteRule( KeyModifyRuleType deleteRule );
+
+ /**
+ * Can the evaluation of foreign key constraints be deferred until commit
+ *
+ * @return the evaluation of foreign key constraints be deferred until commit
+ */
+ KeyDeferrabilityType getDeferrability();
+
+ /**
+ * Can the evaluation of foreign key constraints be deferred until commit
+ *
+ * @param keyDeferrabilityType the evaluation of foreign key constraints be deferred until commit
+ */
+ void setDeferrability( KeyDeferrabilityType deferrability );
+}
+
+/*
+ * $Log$
+ *
+ */
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKeyColumn.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKeyColumn.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ForeignKeyColumn.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table foreign key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface ForeignKeyColumn extends KeyColumn {
+
+ /**
+ * Returns mapped source column (in PK/source table) for this foreign key column
+ *
+ * @return mapped source column (in PK/source table) for this foreign key column
+ */
+ TableColumn getSourceColumn();
+
+ /**
+ * Sets mapped source column (in PK/source table) for this foreign key column
+ *
+ * @param sourceColumn mapped source column (in PK/source table) for this foreign key column
+ */
+ void setSourceColumn( TableColumn sourceColumn );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Index.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Index.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Index.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides all database table's index specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Index extends SchemaObject {
+
+ /**
+ * Retrieves index columns
+ *
+ * @return index columns
+ */
+ Set<IndexColumn> getColumns();
+
+ /**
+ * Adds IndexColumn
+ *
+ * @param indexColumn the IndexColumn
+ */
+ void addColumn( IndexColumn indexColumn );
+
+ /**
+ * delete IndexColumn
+ *
+ * @param indexColumn the IndexColumn
+ */
+ void deleteColumn( IndexColumn indexColumn );
+
+ /**
+ * Returns index column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return index column for specified column name or null.
+ */
+ IndexColumn findColumnByName( String columnName );
+
+ /**
+ * Can index values be non-unique. false when TYPE is tableIndexStatistic.
+ *
+ * @return true if index values can be non-unique.
+ */
+ Boolean isUnique();
+
+ /**
+ * Can index values be non-unique. false when TYPE is tableIndexStatistic.
+ *
+ * @param unique true if index values can be non-unique.
+ */
+ void setUnique( Boolean unique );
+
+ /**
+ * Gets index type
+ *
+ * @return index type
+ */
+ IndexType getIndexType();
+
+ /**
+ * Sets index type
+ *
+ * @param indexType index type
+ */
+ void setIndexType( IndexType indexType );
+
+ /**
+ * When TYPE is tableIndexStatistic, then this is the number of rows in the table; otherwise, it is the number of unique
+ * values in the index.
+ *
+ * @return the number of rows in the table if index type is STATISTICS; otherwise, the number of unique values in the index.
+ */
+ Integer getCardinality();
+
+ /**
+ * When TYPE is tableIndexStatistic, then this is the number of rows in the table; otherwise, it is the number of unique
+ * values in the index.
+ *
+ * @param cardinality the number of rows in the table if index type is STATISTICS; otherwise, the number of unique values in
+ * the index.
+ */
+ void setCardinality( Integer cardinality );
+
+ /**
+ * When TYPE is tableIndexStatisic then this is the number of pages used for the table, otherwise it is the number of pages
+ * used for the current index.
+ *
+ * @return the number of pages used for the table if index type is STATISTICS; otherwise the number of pages used for the
+ * current index.
+ */
+ Integer getPages();
+
+ /**
+ * When TYPE is tableIndexStatisic then this is the number of pages used for the table, otherwise it is the number of pages
+ * used for the current index.
+ *
+ * @param pages the number of pages used for the table if index type is STATISTICS; otherwise the number of pages used for the
+ * current index.
+ */
+ void setPages( Integer pages );
+
+ /**
+ * Returns the filter condition, if any. (may be null)
+ *
+ * @return the filter condition, if any. (may be null)
+ */
+ String getFilterCondition();
+
+ /**
+ * Sets the filter condition, if any. (may be null)
+ *
+ * @param filterCondition the filter condition, if any. (may be null)
+ */
+ void setFilterCondition( String filterCondition );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexColumn.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexColumn.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexColumn.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table index column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface IndexColumn extends KeyColumn {
+
+ /**
+ * Gets column sort sequence type
+ *
+ * @return column sort sequence type
+ */
+ SortSequenceType getSortSequenceType();
+
+ /**
+ * Sets column sort sequence type
+ *
+ * @param sortSequenceType column sort sequence type
+ */
+ void setSortSequenceType( SortSequenceType sortSequenceType );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/IndexType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported standard index types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum IndexType {
+
+ STATISTIC(DatabaseMetaData.tableIndexStatistic), // Indicates that this column contains table statistics that
+ // are returned in conjunction with a table's index descriptions.
+ CLUSTERED(DatabaseMetaData.tableIndexClustered), // Indicates that this table index is a clustered index.
+ HASHED(DatabaseMetaData.tableIndexHashed), // Indicates that this table index is a hashed index.
+ OTHER(DatabaseMetaData.tableIndexOther); // Indicates that this table index is not a clustered index,
+ // a hashed index, or table statistics; it is something other than these.
+
+ private final int type;
+
+ IndexType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyColumn.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyColumn.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyColumn.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface KeyColumn extends TableColumn {
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyDeferrabilityType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyDeferrabilityType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyDeferrabilityType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported key deferrability types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum KeyDeferrabilityType {
+
+ INITIALLY_DEFERRED(DatabaseMetaData.importedKeyInitiallyDeferred), // Indicates deferrability. See SQL-92 for a definition.
+ INTIALLY_IMMEDIATE(DatabaseMetaData.importedKeyInitiallyImmediate), // Indicates deferrability. See SQL-92 for a definition.
+ NOT_DEFERRABLE(DatabaseMetaData.importedKeyNotDeferrable); // Indicates deferrability. See SQL-92 for a definition.
+
+ private final int deferrability;
+
+ KeyDeferrabilityType( int deferrability ) {
+ this.deferrability = deferrability;
+ }
+
+ public int getDeferrability() {
+ return deferrability;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyModifyRuleType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyModifyRuleType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/KeyModifyRuleType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported keys update/delete rule types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum KeyModifyRuleType {
+
+ CASCADE(DatabaseMetaData.importedKeyCascade), // when the primary key is updated/deleted, the foreign key (imported key) is
+ // changed/deleted to agree with it;
+ RESTRICT(DatabaseMetaData.importedKeyRestrict), // a primary key may not be updated/deleted if it has been imported by another
+ // table as a foreign key.
+ SET_NULL(DatabaseMetaData.importedKeySetNull), // when the primary key is updated or deleted, the foreign key (imported key)
+ // is changed to <code>NULL</code>.
+ NO_ACTION(DatabaseMetaData.importedKeyNoAction), // if the primary key has been imported, it cannot be updated or deleted.
+ SET_DEFAULT(DatabaseMetaData.importedKeySetDefault); // if the primary key is updated or deleted, the foreign key (imported
+ // key) is set to the default value.
+
+ private final int rule;
+
+ KeyModifyRuleType( int rule ) {
+ this.rule = rule;
+ }
+
+ public int getRule() {
+ return rule;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/NullabilityType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/NullabilityType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/NullabilityType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides RDBMS supported nullability as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum NullabilityType {
+
+ NO_NULLS(0), // Indicates that <code>NULL</code> values are not allowed.
+ NULLABLE(1), // Indicates that <code>NULL</code> values are allowed.
+ UNKNOWN(2); // Indicates that whether <code>NULL</code> values are allowed is unknown.
+
+ private final int nullability;
+
+ NullabilityType( int nullability ) {
+ this.nullability = nullability;
+ }
+
+ public int getNullability() {
+ return nullability;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Parameter.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Parameter.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Parameter.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all SP column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Parameter extends Column {
+
+ /**
+ * Gets stored procedure parameter I/O type
+ *
+ * @return stored procedure parameter I/O type
+ */
+ ParameterIoType getIoType();
+
+ /**
+ * Sets stored procedure parameter I/O type
+ *
+ * @param parameterIoType stored procedure parameter I/O type
+ */
+ void setIoType( ParameterIoType parameterIoType );
+
+ /**
+ * Returns parameter scale if appropriate
+ *
+ * @return scale if appropriate
+ */
+ Integer getScale();
+
+ /**
+ * Sets parameter scale if appropriate
+ *
+ * @param scale the scale if appropriate
+ */
+ void setScale( Integer scale );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ParameterIoType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ParameterIoType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ParameterIoType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported stored procedure parameter types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum ParameterIoType {
+
+ UNKNOWN(DatabaseMetaData.procedureColumnUnknown), // Indicates that type of the column is unknown.
+ IN(DatabaseMetaData.procedureColumnIn), // Indicates that the column stores IN parameters.
+ IN_OUT(DatabaseMetaData.procedureColumnInOut), // Indicates that the column stores INOUT parameters.
+ OUT(DatabaseMetaData.procedureColumnOut), // Indicates that the column stores OUT parameters.
+ RET(DatabaseMetaData.procedureColumnReturn), // Indicates that the column stores return values.
+ RESULT(DatabaseMetaData.procedureColumnResult); // Indicates that the column stores results.
+
+ private final int type;
+
+ ParameterIoType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKey.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKey.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKey.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides database table's primary key specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface PrimaryKey extends SchemaObject {
+
+ /**
+ * Retrieves primary key columns
+ *
+ * @return primary key columns
+ */
+ Set<PrimaryKeyColumn> getColumns();
+
+ /**
+ * Adds PrimaryKeyColumn
+ *
+ * @param primaryKeyColumn the PrimaryKeyColumn
+ */
+ void addColumn( PrimaryKeyColumn primaryKeyColumn );
+
+ /**
+ * deletes PrimaryKeyColumn
+ *
+ * @param primaryKeyColumn the PrimaryKeyColumn
+ */
+ void deleteColumn( PrimaryKeyColumn primaryKeyColumn );
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ PrimaryKeyColumn findColumnByName( String columnName );
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKeyColumn.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKeyColumn.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrimaryKeyColumn.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table primary key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface PrimaryKeyColumn extends KeyColumn {
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Privilege.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Privilege.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Privilege.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database privilege specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Privilege extends CoreMetaData {
+
+ /**
+ * Returns privilege type
+ *
+ * @return privilege type
+ */
+ PrivilegeType getPrivilegeType();
+
+ /**
+ * Sets privilege type
+ *
+ * @param privilegeType the privilege type
+ */
+ void setPrivilegeType( PrivilegeType privilegeType );
+
+ /**
+ * Return grantor of access (may be <code>null</code>)
+ *
+ * @return grantor of access (may be <code>null</code>)
+ */
+ String getGrantor();
+
+ /**
+ * Sets grantor of access (may be <code>null</code>)
+ *
+ * @param grantor the grantor of access (may be <code>null</code>)
+ */
+ void setGrantor( String grantor );
+
+ /**
+ * Return grantee of access (may be <code>null</code>)
+ *
+ * @return grantee of access (may be <code>null</code>)
+ */
+ String getGrantee();
+
+ /**
+ * Sets grantee of access (may be <code>null</code>)
+ *
+ * @param grantee the grantee of access (may be <code>null</code>)
+ */
+ void setGrantee( String grantee );
+
+ /**
+ * Return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ *
+ * @return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ */
+ String getName();
+
+ /**
+ * Sets name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ *
+ * @param name the name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ */
+ void setName( String name );
+
+ /**
+ * Return true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ *
+ * @return true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ */
+ Boolean isGrantable();
+
+ /**
+ * Sets true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ *
+ * @param grantable true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ */
+ void setGrantable( Boolean grantable );
+
+ /**
+ * Return true if it is unknown: grantee is permitted to grant to others or not
+ *
+ * @return true if it is unknown: grantee is permitted to grant to others or not
+ */
+ Boolean isUnknownGrantable();
+
+ /**
+ * sets true if it is unknown: grantee is permitted to grant to others or not
+ *
+ * @param unknownGrantable true if it is unknown: grantee is permitted to grant to others or not
+ */
+ void setUnknownGrantable( Boolean unknownGrantable );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrivilegeType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrivilegeType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/PrivilegeType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported privilege types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum PrivilegeType {
+ INSERT("INSERT"),
+ SELECT("SELECT"),
+ UPDATE("UPDATE"),
+ DELETE("DELETE"),
+ REFERENCE("REFERENCE"),
+ OTHER("OTHER");
+
+ private final String type;
+
+ PrivilegeType( String type ) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Reference.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Reference.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Reference.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table REF column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Reference extends CoreMetaData {
+ /**
+ * Returns table name that this the scope of a reference attribure
+ *
+ * @return table name that this the scope of a reference attribure
+ */
+ Table getSourceTable();
+
+ /**
+ * Sets table name that this the scope of a reference attribure
+ *
+ * @param sourceTable table name that this the scope of a reference attribure
+ */
+ void setSourceTable( Table sourceTable );
+
+ /**
+ * Returns source type of a distinct type or user-generated Ref type.
+ *
+ * @return source type of a distinct type or user-generated Ref type,
+ */
+ SqlType getSourceDataType();
+
+ /**
+ * Sets source type of a distinct type or user-generated Ref type.
+ *
+ * @param sourceDataType source type of a distinct type or user-generated Ref type,
+ */
+ void setSourceDataType( SqlType sourceDataType );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetConcurrencyType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetConcurrencyType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetConcurrencyType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.ResultSet;
+
+/**
+ * Provides all supported database result set types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.2 (JDBC 2.0)
+ */
+public enum ResultSetConcurrencyType {
+
+ READ_ONLY(ResultSet.CONCUR_READ_ONLY),
+ UPDATABLE(ResultSet.CONCUR_UPDATABLE);
+
+ private final int concurrency;
+
+ ResultSetConcurrencyType( int concurrency ) {
+ this.concurrency = concurrency;
+ }
+
+ public int getConcurrency() {
+ return concurrency;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
+
+/*
+ * $Log$
+ *
+ */
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetHoldabilityType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetHoldabilityType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetHoldabilityType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.ResultSet;
+
+/**
+ * Provides all supported database result set holdability types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.4 (JDBC 3.0)
+ */
+public enum ResultSetHoldabilityType {
+
+ HOLD_CURSORS_OVER_COMMIT(ResultSet.HOLD_CURSORS_OVER_COMMIT),
+ CLOSE_CURSORS_AT_COMMIT(ResultSet.CLOSE_CURSORS_AT_COMMIT);
+
+ private final int holdability;
+
+ ResultSetHoldabilityType( int holdability ) {
+ this.holdability = holdability;
+ }
+
+ public int getHoldability() {
+ return holdability;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/ResultSetType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.ResultSet;
+
+/**
+ * Provides all supported database result set types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.2 (JDBC 2.0)
+ */
+public enum ResultSetType {
+
+ FORWARD_ONLY(ResultSet.TYPE_FORWARD_ONLY),
+ SCROLL_INSENSITIVE(ResultSet.TYPE_SCROLL_INSENSITIVE),
+ SCROLL_SENSITIVE(ResultSet.TYPE_SCROLL_SENSITIVE);
+
+ private final int type;
+
+ ResultSetType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SQLStateType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SQLStateType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SQLStateType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides all supported database SQL types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.4 (JDBC 3.0)
+ */
+public enum SQLStateType {
+
+ XOPEN(DatabaseMetaData.sqlStateXOpen),
+ SQL99(DatabaseMetaData.sqlStateSQL99);
+
+ private final int state;
+
+ SQLStateType( int state ) {
+ this.state = state;
+ }
+
+ public int getState() {
+ return state;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Schema.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Schema.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Schema.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides database schema specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Schema extends DatabaseNamedObject {
+ /**
+ * Gets database catalog
+ *
+ * @return database catalog
+ */
+ Catalog getCatalog();
+
+ /**
+ * Sets database catalog
+ *
+ * @param catalog the database catalog
+ */
+ void setCatalog( Catalog catalog );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SchemaObject.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SchemaObject.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SchemaObject.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides database schema object specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface SchemaObject extends DatabaseNamedObject {
+ /**
+ * Gets database catalog
+ *
+ * @return database catalog
+ */
+ Catalog getCatalog();
+
+ /**
+ * Sets database catalog
+ *
+ * @param catalog the database catalog
+ */
+ void setCatalog( Catalog catalog );
+
+ /**
+ * Gets database schema
+ *
+ * @return database schema
+ */
+ Schema getSchema();
+
+ /**
+ * Sets database schema
+ *
+ * @param schema the database schema
+ */
+ void setSchema( Schema schema );
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SearchabilityType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SearchabilityType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SearchabilityType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported search ability as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum SearchabilityType {
+
+ NOT_SUPPORTED(DatabaseMetaData.typePredNone), // Indicates that <code>WHERE</code> search clauses are not supported for this
+ // type.
+ WHERE_LIKE(DatabaseMetaData.typePredChar), // Indicates that the only <code>WHERE</code> search clause that can be based on
+ // this type is <code>WHERE . . . LIKE</code>.
+ BASIC(DatabaseMetaData.typePredBasic), // Indicates that one can base all <code>WHERE</code> search clauses except <code>WHERE
+ // . . . LIKE</code> on this data type.
+ SEARCHABLE(DatabaseMetaData.typeSearchable); // Indicates that all <code>WHERE</code> search clauses can be based on this
+ // type.
+
+ private final int searchability;
+
+ SearchabilityType( int searchability ) {
+ this.searchability = searchability;
+ }
+
+ public int getSearchability() {
+ return searchability;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SortSequenceType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SortSequenceType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SortSequenceType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported sort sequence types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum SortSequenceType {
+ ASCENDING("A"), // "A" => ascending
+ DESCENDING("D"), // "D" => descending
+ NOT_SUPPORTED(""); // not supported
+
+ private final String type;
+
+ SortSequenceType( String type ) {
+ this.type = type;
+ }
+
+ public String getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.Types;
+
+/**
+ * Provides RDBMS supported standard SQL types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum SqlType {
+
+ BIT(Types.BIT),
+ TINYINT(Types.TINYINT),
+ SMALLINT(Types.SMALLINT),
+ INTEGER(Types.INTEGER),
+ BIGINT(Types.BIGINT),
+ FLOAT(Types.FLOAT),
+ REAL(Types.REAL),
+ DOUBLE(Types.DOUBLE),
+ NUMERIC(Types.NUMERIC),
+ DECIMAL(Types.DECIMAL),
+ CHAR(Types.CHAR),
+ VARCHAR(Types.VARCHAR),
+ LONGVARCHAR(Types.LONGVARCHAR),
+ DATE(Types.DATE),
+ TIME(Types.TIME),
+ TIMESTAMP(Types.TIMESTAMP),
+ BINARY(Types.BINARY),
+ VARBINARY(Types.VARBINARY),
+ LONGVARBINARY(Types.LONGVARBINARY),
+ NULL(Types.NULL),
+ OTHER(Types.OTHER),
+ JAVA_OBJECT(Types.JAVA_OBJECT),
+ DISTINCT(Types.DISTINCT),
+ STRUCT(Types.STRUCT),
+ ARRAY(Types.ARRAY),
+ BLOB(Types.BLOB),
+ CLOB(Types.CLOB),
+ REF(Types.REF),
+ DATALINK(Types.DATALINK),
+ BOOLEAN(Types.BOOLEAN);
+
+ private final int type;
+
+ SqlType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ }
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeConversionPair.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeConversionPair.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeConversionPair.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides RDBMS supported SQL type valid conversion pair.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface SqlTypeConversionPair extends CoreMetaData {
+
+ /**
+ * Gets valid <from> SQL Type
+ *
+ * @return valid <from> SQL Type
+ */
+ SqlType getSrcType();
+
+ /**
+ * Sets valid source SQL Type
+ *
+ * @param srcType the source SQL Type
+ */
+ void setSrcType( SqlType srcType );
+
+ /**
+ * Gets valid destination SQL Type
+ *
+ * @return valid dewstination SQL Type
+ */
+ SqlType getDestType();
+
+ /**
+ * Sets valid destination SQL Type
+ *
+ * @param toType the destination SQL Type
+ */
+ void setDestType( SqlType destType );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeInfo.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeInfo.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/SqlTypeInfo.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,240 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides RDBMS supported standatd SQL types info.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface SqlTypeInfo extends DatabaseNamedObject {
+
+ /**
+ * Returns localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
+ *
+ * @return localized version of type name (may be null)
+ */
+ String getLocalizedTypeName();
+
+ /**
+ * Sets localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
+ *
+ * @param localizedTypeName localized version of type name (may be null)
+ */
+ void setLocalizedTypeName( String localizedTypeName );
+
+ /**
+ * Gets SQL type nullability
+ *
+ * @return SQL type nullability
+ */
+ NullabilityType getNullabilityType();
+
+ /**
+ * Sets SQL type nullability
+ *
+ * @param nullabilityType SQL type nullability
+ */
+ void setNullabilityType( NullabilityType nullabilityType );
+
+ /**
+ * Gets SQL type from java.sql.Types
+ *
+ * @return SQL type from java.sql.Types
+ */
+ SqlType getSqlType();
+
+ /**
+ * Sets SQL type from java.sql.Types
+ *
+ * @param sqlType the SQL type from java.sql.Types
+ */
+ void setSqlType( SqlType sqlType );
+
+ /**
+ * Gets precision (number of fractional digits/scale) if applicable otherwise 0.
+ *
+ * @return precision if applicable otherwise 0
+ */
+ Long getPrecision();
+
+ /**
+ * Sets precision (number of fractional digits/scale) if applicable otherwise 0.
+ *
+ * @param precision precision if applicable otherwise 0
+ */
+ void setPrecision( Long precision );
+
+ /**
+ * Returns true if sql type can be a money value, for instance
+ *
+ * @return true if sql type can be a money value, for instance
+ */
+ Boolean isFixedPrecisionScale();
+
+ /**
+ * Sets true if sql type can be a money value, for instance
+ *
+ * @param fixedPrecisionScale true if sql type can be a money value, for instance
+ */
+ void setFixedPrecisionScale( Boolean fixedPrecisionScale );
+
+ /**
+ * Returns sql type precision radix (usually 2 or 10)
+ *
+ * @return sql type precision radix (usually 2 or 10)
+ */
+ Integer getNumberPrecisionRadix();
+
+ /**
+ * sets sql type precision radix (usually 2 or 10)
+ *
+ * @param numberPrecisionRadix the sql type precision radix (usually 2 or 10)
+ */
+ void setNumberPrecisionRadix( Integer numberPrecisionRadix );
+
+ /**
+ * Returns minimum scale supported
+ *
+ * @return minimum scale supported
+ */
+ Integer getMinScale();
+
+ /**
+ * Sets minimum scale supported
+ *
+ * @param minScale minimum scale supported
+ */
+ void setMinScale( Integer minScale );
+
+ /**
+ * Returns maximum scale supported
+ *
+ * @return maximum scale supported
+ */
+ Integer getMaxScale();
+
+ /**
+ * Sets maximum scale supported
+ *
+ * @param maxScale the maximum scale supported
+ */
+ void setMaxScale( Integer maxScale );
+
+ /**
+ * Returns prefix used to quote a literal (may be null)
+ *
+ * @return prefix used to quote a literal (may be null)
+ */
+ String getLiteralPrefix();
+
+ /**
+ * Sets prefix used to quote a literal (may be null)
+ *
+ * @param literalPrefix the prefix used to quote a literal (may be null)
+ */
+ void setLiteralPrefix( String literalPrefix );
+
+ /**
+ * Returns suffix used to quote a literal (may be null)
+ *
+ * @return suffix used to quote a literal (may be null)
+ */
+ String getLiteralSuffix();
+
+ /**
+ * Sets suffix used to quote a literal (may be null)
+ *
+ * @param literalSuffix the suffix used to quote a literal (may be null)
+ */
+ void setLiteralSuffix( String literalSuffix );
+
+ /**
+ * Returns parameters used in creating the type (may be null)
+ *
+ * @return parameters used in creating the type (may be null)
+ */
+ String getCreateParams();
+
+ /**
+ * Sets parameters used in creating the type (may be null)
+ *
+ * @param createParams the parameters used in creating the type (may be null)
+ */
+ void setCreateParams( String createParams );
+
+ /**
+ * Is sql type case sensitive
+ *
+ * @return true if sql type case sensitive
+ */
+ Boolean isCaseSensitive();
+
+ /**
+ * Is sql type case sensitive
+ *
+ * @param caseSensitive the true if sql type case sensitive
+ */
+ void setCaseSensitive( Boolean caseSensitive );
+
+ /**
+ * Returns sql type searchability
+ *
+ * @return sql type searchability
+ */
+ SearchabilityType getSearchabilityType();
+
+ /**
+ * Sets sql type searchability
+ *
+ * @param searchabilityType the sql type searchability
+ */
+ void setSearchabilityType( SearchabilityType searchabilityType );
+
+ /**
+ * Returns true if sql type is unsigned
+ *
+ * @return true if sql type is unsigned
+ */
+ Boolean isUnsigned();
+
+ /**
+ * Sets true if sql type is unsigned
+ *
+ * @param unsigned true if sql type is unsigned
+ */
+ void setUnsigned( Boolean unsigned );
+
+ /**
+ * Returns true if sql type can be used for an auto-increment value.
+ *
+ * @return true if sql type can be used for an auto-increment value.
+ */
+ Boolean isAutoIncrement();
+
+ /**
+ * Sets true if sql type can be used for an auto-increment value.
+ *
+ * @param autoIncrement true if sql type can be used for an auto-increment value.
+ */
+ void setAutoIncrement( Boolean autoIncrement );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedure.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedure.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedure.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides all core database SPe specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface StoredProcedure extends SchemaObject {
+
+ /**
+ * Gets stored procedure result type
+ *
+ * @return stored procedure result type
+ */
+ StoredProcedureResultType getResultType();
+
+ /**
+ * Sets stored procedure result type
+ *
+ * @param resultType the stored procedure result type
+ */
+ void setResultType( StoredProcedureResultType resultType );
+
+ /**
+ * Gets stored procedure columns
+ *
+ * @return a set of stored procedure columns.
+ */
+ Set<Parameter> getParameters();
+
+ /**
+ * Adds Parameter
+ *
+ * @param parameter the Parameter
+ */
+ void addParameter( Parameter parameter );
+
+ /**
+ * deletes Parameter
+ *
+ * @param parameter the Parameter
+ */
+ void deleteParameter( Parameter parameter );
+
+ /**
+ * Returns stored procedure parameter for specified name or null
+ *
+ * @param parameterName the name of parameter
+ * @return stored procedure parameter for specified name or null.
+ */
+ Parameter findParameterByName( String parameterName );
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedureResultType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedureResultType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/StoredProcedureResultType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.DatabaseMetaData;
+
+/**
+ * Provides RDBMS supported stored procedure result types as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum StoredProcedureResultType {
+
+ UNKNOWN(DatabaseMetaData.procedureResultUnknown), // Indicates that it is not known whether the procedure returns a result
+ NO_RESULT(DatabaseMetaData.procedureNoResult), // Indicates that the procedure does not return a result.
+ RETURNS_RESULT(DatabaseMetaData.procedureReturnsResult); // Indicates that the procedure returns a result.
+
+ private final int type;
+
+ StoredProcedureResultType( int type ) {
+ this.type = type;
+ }
+
+ public int getType() {
+ return type;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Table.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Table.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/Table.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,328 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides all core database table specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface Table extends SchemaObject {
+
+ /**
+ * Returns type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ *
+ * @return type of table.
+ */
+ TableType getTableType();
+
+ /**
+ * Sets type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ *
+ * @param tableType the type of table.
+ */
+ void setTableType( TableType tableType );
+
+ /**
+ * Gets type catalog
+ *
+ * @return types catalog (may be <code>null</code>)
+ */
+ Catalog getTypeCatalog();
+
+ /**
+ * Sets type catalog
+ *
+ * @param typeCatalog the types catalog (may be <code>null</code>)
+ */
+ void setTypeCatalog( Catalog typeCatalog );
+
+ /**
+ * Gets type schema
+ *
+ * @return types schema (may be <code>null</code>)
+ */
+ Schema getTypeSchema();
+
+ /**
+ * Sets type schema
+ *
+ * @param typeSchema the types schema (may be <code>null</code>)
+ */
+ void setTypeSchema( Schema typeSchema );
+
+ /**
+ * Gets type name
+ *
+ * @return types name (may be <code>null</code>)
+ */
+ String getTypeName();
+
+ /**
+ * Sets type name
+ *
+ * @param typeName types name (may be <code>null</code>)
+ */
+ void setTypeName( String typeName );
+
+ /**
+ * Gets name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ *
+ * @return name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ */
+ String getSelfReferencingColumnName();
+
+ /**
+ * Sets name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ *
+ * @param selfReferencingColumnName the name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ */
+ void setSelfReferencingColumnName( String selfReferencingColumnName );
+
+ /**
+ * specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be
+ * <code>null</code>)
+ *
+ * @return how values in getSelfReferencingColumnName () are created.
+ */
+ String getReferenceGeneration();
+
+ /**
+ * specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be
+ * <code>null</code>)
+ *
+ * @param referenceGeneration how values in getSelfReferencingColumnName () are created.
+ */
+ void setReferenceGeneration( String referenceGeneration );
+
+ /**
+ * Gets a set of table columns
+ *
+ * @return a set of table columns.
+ */
+ Set<TableColumn> getColumns();
+
+ /**
+ * Adds TableColumn
+ *
+ * @param column the TableColumn
+ */
+ void addColumn( TableColumn column );
+
+ /**
+ * deletes TableColumn
+ *
+ * @param column the TableColumn
+ */
+ void deleteColumn( TableColumn column );
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ TableColumn findColumnByName( String columnName );
+
+ /**
+ * Gets a table primary key
+ *
+ * @return a table primary key.
+ */
+ PrimaryKey getPrimaryKey();
+
+ /**
+ * Sets a table primary key
+ *
+ * @param primaryKey the table primary key.
+ */
+ void setPrimaryKey( PrimaryKey primaryKey );
+
+ /**
+ * Gets a set of table foreign key columns
+ *
+ * @return a set of table foreign keys.
+ */
+ Set<ForeignKey> getForeignKeys();
+
+ /**
+ * adds ForeignKey
+ *
+ * @param foreignKey the ForeignKey
+ */
+ void addForeignKey( ForeignKey foreignKey );
+
+ /**
+ * deletes ForeignKey
+ *
+ * @param foreignKey the ForeignKey
+ */
+ void deleteForeignKey( ForeignKey foreignKey );
+
+ /**
+ * Returns table foreign key for specified name or null
+ *
+ * @param fkName the name of foreign key
+ * @return table foreign key for specified name or null.
+ */
+ ForeignKey findForeignKeyByName( String fkName );
+
+ /**
+ * Gets a set of table indexes
+ *
+ * @return a set of table indexes.
+ */
+ Set<Index> getIndexes();
+
+ /**
+ * adds Index
+ *
+ * @param index the Index
+ */
+ void addIndex( Index index );
+
+ /**
+ * deletes Index
+ *
+ * @param index the Index
+ */
+ void deleteIndex( Index index );
+
+ /**
+ * Returns table index for specified name or null
+ *
+ * @param indexName the name of index
+ * @return table index for specified name or null.
+ */
+ Index findIndexByName( String indexName );
+
+ /**
+ * Gets a set of table version columns
+ *
+ * @return a set of table version columns.
+ */
+ Set<TableColumn> getVersionColumns();
+
+ /**
+ * adds version column
+ *
+ * @param tableColumn the TableColumn
+ */
+ void addVersionColumn( TableColumn tableColumn );
+
+ /**
+ * deletes version column
+ *
+ * @param tableColumn the version column
+ */
+ void deleteVersionColumn( TableColumn tableColumn );
+
+ /**
+ * Returns table version column for specified name or null
+ *
+ * @param columnName the name of Version Column
+ * @return table Version Column for specified name or null.
+ */
+ TableColumn findVersionColumnByName( String columnName );
+
+ /**
+ * Gets table privileges.
+ *
+ * @return set of table privileges
+ */
+ Set<Privilege> getPrivileges();
+
+ /**
+ * Adds table priviledge
+ *
+ * @param privilege the table priviledge
+ */
+ void addPrivilege( Privilege privilege );
+
+ /**
+ * Deletes table priviledge
+ *
+ * @param privilege the table priviledge
+ */
+ void deletePrivilege( Privilege privilege );
+
+ /**
+ * Searches priviledge by name
+ *
+ * @param priviledgeName the priviledge name to search
+ * @return priviledge if found, otherwise return null
+ */
+ Privilege findPriviledgeByName( String priviledgeName );
+
+ /**
+ * Retrieves a set of descriptions of a table's optimal set of columns that uniquely identifies a row in temporary scopes.
+ *
+ * @return BestRowIdentifier set that uniquely identifies a row in scopes.
+ */
+ Set<BestRowIdentifier> getBestRowIdentifiers();
+
+ /**
+ * Adds BestRowIdentifier
+ *
+ * @param bestRowIdentifier the BestRowIdentifier
+ */
+ void addBestRowIdentifier( BestRowIdentifier bestRowIdentifier );
+
+ /**
+ * deletes BestRowIdentifier
+ *
+ * @param bestRowIdentifier the BestRowIdentifier
+ */
+ void deleteBestRowIdentifier( BestRowIdentifier bestRowIdentifier );
+
+ /**
+ * Searches the BestRowIdentifier by scope
+ *
+ * @param scopeType the scope of best row identifier
+ * @return BestRowIdentifier if any
+ */
+ BestRowIdentifier findBestRowIdentifierByScopeType( BestRowIdentifierScopeType scopeType );
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves a description of the table hierarchies defined in a particular schema in this database. Only the immediate super
+ * type/ sub type relationship is modeled.
+ *
+ * @return super table for this table
+ * @since 1.4 (JDBC 3.0)
+ */
+ Table getSuperTable();
+
+ /**
+ * Sets a description of the table hierarchies defined in a particular schema in this database. Only the immediate super type/
+ * sub type relationship is modeled.
+ *
+ * @param superTable the super table for this table
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSuperTable( Table superTable );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableColumn.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableColumn.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableColumn.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides all database table column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface TableColumn extends Column {
+
+ /**
+ * Is this column the part of Best Row Identifier in any scope?
+ *
+ * @return true if this column is the part of Best Row Identifier in any scope, otherwise return false (even if unknown)
+ */
+ Boolean isBestRowIdentifier();
+
+ /**
+ * Is this column the part of Best Row Identifier in any scope?
+ *
+ * @param bestRowIdentifier true if this column is the part of Best Row Identifier in any scope, otherwise return false (even
+ * if unknown)
+ */
+ void setBestRowIdentifier( Boolean bestRowIdentifier );
+
+ /**
+ * Return column's pseudo type
+ *
+ * @return column's pseudo type
+ */
+ ColumnPseudoType getPseudoType();
+
+ /**
+ * Sets column's pseudo type
+ *
+ * @param pseudoType the column's pseudo type
+ */
+ void setPseudoType( ColumnPseudoType pseudoType );
+
+ /**
+ * Returns column reference if datatype is REF
+ *
+ * @return column reference if datatype is REF
+ */
+ Reference getReference();
+
+ /**
+ * Sets column reference if datatype is REF
+ *
+ * @param reference the column reference if datatype is REF
+ */
+ void setReference( Reference reference );
+
+ /**
+ * Retrieves true if column is automatically updated when any value in a row is updated. If it retrieves true then column can
+ * be cast to VersionColumn.
+ *
+ * @return true if column is automatically updated when any value in a row is updated, return false overwise.
+ */
+ Boolean isVersionColumn();
+
+ /**
+ * Sets true if column is automatically updated when any value in a row is updated. If it retrieves true then column can be
+ * cast to VersionColumn.
+ *
+ * @param versionColumn true if column is automatically updated when any value in a row is updated, return false overwise.
+ */
+ void setVersionColumn( Boolean versionColumn );
+
+ /**
+ * Retrieves true if column is part of primary key.
+ *
+ * @return true if column is part of primary key, return false overwise.
+ */
+ Boolean isPrimaryKeyColumn();
+
+ /**
+ * Sets true if column is part of primary key.
+ *
+ * @param primaryKeyColumn true if column is part of primary key, return false overwise.
+ */
+ void setPrimaryKeyColumn( Boolean primaryKeyColumn );
+
+ /**
+ * Retrieves true if column is part of foreign key.
+ *
+ * @return true if column is part of foreign key, return false overwise.
+ */
+ Boolean isForeignKeyColumn();
+
+ /**
+ * Sets true if column is part of foreign key.
+ *
+ * @param foreignKeyColumn true if column is part of foreign key, return false overwise.
+ */
+ void setForeignKeyColumn( Boolean foreignKeyColumn );
+
+ /**
+ * Retrieves true if column is part of any index.
+ *
+ * @return true if column is part of any index, return false overwise.
+ */
+ Boolean isIndexColumn();
+
+ /**
+ * Sets true if column is part of any index.
+ *
+ * @param indexColumn true if column is part of any index, return false overwise.
+ */
+ void setIndexColumn( Boolean indexColumn );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TableType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+/**
+ * Provides database table type specific metadata.
+ * <P>
+ * The table type is:
+ * <OL>
+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ * </OL>
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface TableType extends DatabaseNamedObject {
+ public static String DEF_TABLE_TYPE_TABLE = "TABLE";
+ public static String DEF_TABLE_TYPE_VIEW = "VIEW";
+ public static String DEF_TABLE_TYPE_SYS_TABLE = "SYSTEM TABLE";
+ public static String DEF_TABLE_TYPE_GLOBAL_TEMP = "GLOBAL TEMPORARY";
+ public static String DEF_TABLE_TYPE_LOCAL_TEMP = "LOCAL TEMPORARY";
+ public static String DEF_TABLE_TYPE_ALIAS = "ALIAS";
+ public static String DEF_TABLE_TYPE_SYNONYM = "SYNONYM";
+
+ /**
+ * Is table type represents TABLE
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents TABLE
+ */
+ Boolean isTable( String tableTypeName );
+
+ /**
+ * Is current table type represents TABLE
+ *
+ * @return true if current table type represents TABLE
+ */
+ Boolean isTable();
+
+ /**
+ * Is table type represents VIEW
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents VIEW
+ */
+ Boolean isView( String tableTypeName );
+
+ /**
+ * Is current table type represents VIEW
+ *
+ * @return true if current table type represents VIEW
+ */
+ Boolean isView();
+
+ /**
+ * Is table type represents SYSTEM TABLE
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents SYSTEM TABLE
+ */
+ Boolean isSystemTable( String tableTypeName );
+
+ /**
+ * Is current table type represents SYSTEM TABLE
+ *
+ * @return true if current table type represents SYSTEM TABLE
+ */
+ Boolean isSystemTable();
+
+ /**
+ * Is current table type represents GLOBAL TEMPORARY
+ *
+ * @param tableTypeName the table type string
+ * @return true if current table type represents GLOBAL TEMPORARY
+ */
+ Boolean isGlobalTemporary( String tableTypeName );
+
+ /**
+ * Is current table type represents GLOBAL TEMPORARY
+ *
+ * @return true if table type represents GLOBAL TEMPORARY
+ */
+ Boolean isGlobalTemporary();
+
+ /**
+ * Is table type represents LOCAL TEMPORARY
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents LOCAL TEMPORARY
+ */
+ Boolean islocalTemporary( String tableTypeName );
+
+ /**
+ * Is current table type represents LOCAL TEMPORARY
+ *
+ * @return true if current table type represents LOCAL TEMPORARY
+ */
+ Boolean isLocalTemporary();
+
+ /**
+ * Is table type represents ALIAS
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents ALIAS
+ */
+ Boolean isAlias( String tableTypeName );
+
+ /**
+ * Is current table type represents ALIAS
+ *
+ * @return true if current table type represents ALIAS
+ */
+ Boolean isAlias();
+
+ /**
+ * Is table type represents SYNONYM
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents SYNONYM
+ */
+ Boolean isSynonym( String tableTypeName );
+
+ /**
+ * Is current table type represents SYNONYM
+ *
+ * @param tableTypeName the table type string
+ * @return true if current table type represents SYNONYM
+ */
+ Boolean isSynonym();
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TransactionIsolationLevelType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TransactionIsolationLevelType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/TransactionIsolationLevelType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.sql.Connection;
+
+/**
+ * Provides RDBMS supported transaction isolation levels as enumeration set.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public enum TransactionIsolationLevelType {
+
+ NONE(Connection.TRANSACTION_NONE),
+ READ_UNCOMMITTED(Connection.TRANSACTION_READ_UNCOMMITTED),
+ READ_COMMITTED(Connection.TRANSACTION_READ_COMMITTED),
+ REPEATABLE_READ(Connection.TRANSACTION_REPEATABLE_READ),
+ SERIALIZABLE(Connection.TRANSACTION_SERIALIZABLE);
+
+ private final int level;
+
+ TransactionIsolationLevelType( int level ) {
+ this.level = level;
+ }
+
+ public int getLevel() {
+ return level;
+ };
+
+ public String getName() {
+ return name();
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/UserDefinedType.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/UserDefinedType.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/api/UserDefinedType.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.api;
+
+import java.util.Set;
+
+/**
+ * Provides User Defined Type (UDT) specific metadata. Retrieves a description of the user-defined types (UDTs) defined in a
+ * particular schema. Schema-specific UDTs may have type JAVA_OBJECT, STRUCT, or DISTINCT.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.2 (JDBC 2.0)
+ */
+public interface UserDefinedType extends SchemaObject {
+
+ /**
+ * Returns JAVA class name for UDT
+ *
+ * @return JAVA class name for UDT
+ */
+ String getClassName();
+
+ /**
+ * Sets JAVA class name for UDT
+ *
+ * @param className JAVA class name for UDT
+ */
+ void setClassName( String className );
+
+ /**
+ * Gets SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ *
+ * @return SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ */
+ SqlType getSqlType();
+
+ /**
+ * Sets SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ *
+ * @param sqlType the SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ */
+ void setSqlType( SqlType sqlType );
+
+ /**
+ * Gets SQL base type from java.sql.Types. Type code of the source type of a DISTINCT type or the type that implements the
+ * user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (null if
+ * DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)
+ *
+ * @return SQL base type from java.sql.Types.
+ */
+ SqlType getBaseType();
+
+ /**
+ * Sets SQL base type from java.sql.Types. Type code of the source type of a DISTINCT type or the type that implements the
+ * user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (null if
+ * DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)
+ *
+ * @param baseSqlType the SQL base type from java.sql.Types.
+ */
+ void setBaseType( SqlType baseType );
+
+ /**
+ * Gets a set of UDT attributes
+ *
+ * @return a set of UDT attributes
+ */
+ Set<Attribute> getAttributes();
+
+ /**
+ * adds Attribute
+ *
+ * @param attribute the Attribute
+ */
+ void addAttribute( Attribute attribute );
+
+ /**
+ * deletes Attribute
+ *
+ * @param attribute the Attribute
+ */
+ void deleteAttribute( Attribute attribute );
+
+ /**
+ * Returns UDT attribute for specified attribute name or null
+ *
+ * @param attributeName the name of attribute
+ * @return UDT attribute for specified attribute name or null.
+ */
+ Attribute findAttributeByName( String attributeName );
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database. Only
+ * the immediate super type/ sub type relationship is modeled.
+ *
+ * @return super type for this UDT if any
+ * @since 1.4 (JDBC 3.0)
+ */
+ UserDefinedType getSuperType();
+
+ /**
+ * Sets a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database. Only the
+ * immediate super type/ sub type relationship is modeled.
+ *
+ * @param superType the super type for this UDT if any
+ * @since 1.4 (JDBC 3.0)
+ */
+ void setSuperType( UserDefinedType superType );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/AttributeBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/AttributeBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/AttributeBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Attribute;
+import org.jboss.dna.common.jdbc.model.api.Reference;
+
+/**
+ * Provides User Defined Type (UDT) attribute specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.4 (JDBC 3.0)
+ */
+public class AttributeBean extends ColumnBean implements Attribute {
+ private static final long serialVersionUID = -2822658260714209072L;
+ private Reference reference;
+
+ /**
+ * Default constructor
+ */
+ public AttributeBean() {
+ }
+
+ /**
+ * Returns column reference if datatype is REF
+ *
+ * @return column reference if datatype is REF
+ */
+ public Reference getReference() {
+ return reference;
+ }
+
+ /**
+ * Sets reference
+ *
+ * @param reference the reference to set
+ */
+ public void setReference( Reference reference ) {
+ this.reference = reference;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifier;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifierScopeType;
+import org.jboss.dna.common.jdbc.model.api.Column;
+
+/**
+ * Provides table's best row identifies specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class BestRowIdentifierBean extends CoreMetaDataBean implements BestRowIdentifier {
+ private static final long serialVersionUID = -6031029115876541704L;
+ private BestRowIdentifierScopeType scopeType;
+ private Set<Column> columns = new HashSet<Column>();
+
+ /**
+ * Default constructor
+ */
+ public BestRowIdentifierBean() {
+ }
+
+ /**
+ * Return the scope of best row identifier
+ *
+ * @return the scope of best row identifier
+ */
+ public BestRowIdentifierScopeType getScopeType() {
+ return scopeType;
+ }
+
+ /**
+ * Sets the scope of best row identifier
+ *
+ * @param scopeType the scope of best row identifier
+ */
+ public void setScopeType( BestRowIdentifierScopeType scopeType ) {
+ this.scopeType = scopeType;
+ }
+
+ /**
+ * Retrieves best row identifier columns
+ *
+ * @return best row identifier columns
+ */
+ public Set<Column> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Adds column to the best row identifier
+ *
+ * @param column the column that part of best row identifier
+ */
+ public void addColumn( Column column ) {
+ columns.add(column);
+ }
+
+ /**
+ * Deletes column from the best row identifier
+ *
+ * @param column the column that no longer part of best row identifier
+ */
+ public void deleteColumn( Column column ) {
+ columns.remove(column);
+ }
+
+ /**
+ * Searches column by name
+ *
+ * @param columnName the column name to search
+ * @return column if found, otherwise return null
+ */
+ public Column findColumnByName( String columnName ) {
+ for (Column c : columns) {
+ if (c.getName().equals(columnName)) {
+ return c;
+ }
+ }
+ // return nothing
+ return null;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CatalogBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CatalogBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CatalogBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+
+/**
+ * Provides all core database catalog specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class CatalogBean extends DatabaseNamedObjectBean implements Catalog {
+ private static final long serialVersionUID = -4579895771907682612L;
+
+ /**
+ * Default constructor
+ */
+ public CatalogBean() {
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,285 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.Column;
+import org.jboss.dna.common.jdbc.model.api.NullabilityType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+import org.jboss.dna.common.jdbc.model.api.SchemaObject;
+
+/**
+ * Provides all column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ColumnBean extends DatabaseNamedObjectBean implements Column {
+ private static final long serialVersionUID = 4797227922671541353L;
+ private SchemaObject owner;
+ private NullabilityType nullabilityType;
+ private SqlType sqlType;
+ private String typeName;
+ private Integer size;
+ private Integer precision;
+ private Integer radix;
+ private String defaultValue;
+ private Integer ordinalPosition;
+ private Integer charOctetLength;
+ private Set<Privilege> privileges = new HashSet<Privilege>();
+
+ /**
+ * Default constructor
+ */
+ public ColumnBean() {
+ }
+
+ /**
+ * Returns owner of ColumnMetaData such as Table, or Stored Procedure, UDT, PK, FK, Index, etc. May return NULL
+ *
+ * @return owner of ColumnMetaData such as Table, or Stored Procedure, or UDT, PK, FK, Index, etc. May return NULL
+ */
+ public SchemaObject getOwner() {
+ return owner;
+ }
+
+ /**
+ * Sets the owner of ColumnMetaData
+ *
+ * @param owner the owner of ColumnMetaData
+ */
+ public void setOwner( SchemaObject owner ) {
+ this.owner = owner;
+ }
+
+ /**
+ * Gets column nullability
+ *
+ * @return column nullability
+ */
+ public NullabilityType getNullabilityType() {
+ return nullabilityType;
+ }
+
+ /**
+ * Sets column nullability
+ *
+ * @param nullabilityType the column nullability
+ */
+ public void setNullabilityType( NullabilityType nullabilityType ) {
+ this.nullabilityType = nullabilityType;
+ }
+
+ /**
+ * Gets SQL type from java.sql.Types
+ *
+ * @return SQL type from java.sql.Types
+ */
+ public SqlType getSqlType() {
+ return sqlType;
+ }
+
+ /**
+ * Sets SQL type from java.sql.Types
+ *
+ * @param sqlType the SQL type from java.sql.Types
+ */
+ public void setSqlType( SqlType sqlType ) {
+ this.sqlType = sqlType;
+ }
+
+ /**
+ * Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified
+ * and represents the target type of the reference type.
+ *
+ * @return data source dependent type name
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified
+ * and represents the target type of the reference type.
+ *
+ * @param typeName data source dependent type name
+ */
+ public void setTypeName( String typeName ) {
+ this.typeName = typeName;
+ }
+
+ /**
+ * Gets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is
+ * precision. For Stored procedure columns it is length in bytes of data
+ *
+ * @return column size
+ */
+ public Integer getSize() {
+ return size;
+ }
+
+ /**
+ * Sets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is
+ * precision. For Stored procedure columns it is length in bytes of data
+ *
+ * @param size the column size
+ */
+ public void setSize( Integer size ) {
+ this.size = size;
+ }
+
+ /**
+ * Gets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure
+ * column - scale.
+ *
+ * @return precision if applicable otherwise 0
+ */
+ public Integer getPrecision() {
+ return precision;
+ }
+
+ /**
+ * Sets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure
+ * column - scale.
+ *
+ * @param precision the precision if applicable otherwise 0
+ */
+ public void setPrecision( Integer precision ) {
+ this.precision = precision;
+ }
+
+ /**
+ * Gets radix if applicable
+ *
+ * @return radix if applicable
+ */
+ public Integer getRadix() {
+ return radix;
+ }
+
+ /**
+ * Sets radix if applicable
+ *
+ * @param radix if applicable
+ */
+ public void setRadix( Integer radix ) {
+ this.radix = radix;
+ }
+
+ /**
+ * Gets default value (may be <code>null</code>)
+ *
+ * @return default value (may be <code>null</code>)
+ */
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * Sets default value (may be <code>null</code>)
+ *
+ * @param defaultValue the default value (may be <code>null</code>)
+ */
+ public void setDefaultValue( String defaultValue ) {
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Returns index of column starting at 1 - if applicable. Otherwise returns -1.
+ *
+ * @return index of column starting at 1 - if applicable. Otherwise returns -1.
+ */
+ public Integer getOrdinalPosition() {
+ return ordinalPosition;
+ }
+
+ /**
+ * Sets index of column starting at 1 - if applicable. Otherwise returns -1.
+ *
+ * @param ordinalPosition the index of column starting at 1 - if applicable. Otherwise returns -1.
+ */
+ public void setOrdinalPosition( Integer ordinalPosition ) {
+ this.ordinalPosition = ordinalPosition;
+ }
+
+ /**
+ * For char types returns the maximum number of bytes in the column. Otherwise returns -1.
+ *
+ * @return For char types returns the maximum number of bytes in the column. Otherwise returns -1.
+ */
+ public Integer getCharOctetLength() {
+ return charOctetLength;
+ }
+
+ /**
+ * For char types sets the maximum number of bytes in the column. Otherwise -1.
+ *
+ * @param charOctetLength For char types sets the maximum number of bytes in the column. Otherwise -1.
+ */
+ public void setCharOctetLength( Integer charOctetLength ) {
+ this.charOctetLength = charOctetLength;
+ }
+
+ /**
+ * Gets table column privileges.
+ *
+ * @return set of table column privileges
+ */
+ public Set<Privilege> getPrivileges() {
+ return privileges;
+ }
+
+ /**
+ * Adds table column priviledge
+ *
+ * @param privilege the table column priviledge
+ */
+ public void addPrivilege( Privilege privilege ) {
+ privileges.add(privilege);
+ }
+
+ /**
+ * Deletes table column priviledge
+ *
+ * @param privilege the table column priviledge
+ */
+ public void deletePrivilege( Privilege privilege ) {
+ privileges.remove(privilege);
+ }
+
+ /**
+ * Searches priviledge by name
+ *
+ * @param priviledgeName the priviledge name to search
+ * @return priviledge if found, otherwise return null
+ */
+ public Privilege findPriviledgeByName( String priviledgeName ) {
+ for (Privilege p : privileges) {
+ if (p.getName().equals(priviledgeName)) {
+ return p;
+ }
+ }
+ // return nothing
+ return null;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.io.Serializable;
+import org.jboss.dna.common.jdbc.model.api.CoreMetaData;
+
+/**
+ * Provides core metadata functionality
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class CoreMetaDataBean implements CoreMetaData {
+ /**
+ * Default constructor
+ */
+ public CoreMetaDataBean() {
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,4075 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.*;
+
+/**
+ * Provides RDBMS wide meta data retrieved from java.sql.DatabaseMetaData.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseBean extends CoreMetaDataBean implements Database {
+ private static final long serialVersionUID = 6634428066138252064L;
+ // database metadata provider exception list
+ private List<DatabaseMetaDataMethodException> exceptionList = new ArrayList<DatabaseMetaDataMethodException>();
+ private String name;
+ private Boolean allProceduresAreCallable;
+ private Boolean allTablesAreSelectable;
+ private String url;
+ private String userName;
+ private Boolean readOnly;
+ private Boolean nullsAreSortedHigh;
+ private Boolean nullsAreSortedLow;
+ private Boolean nullsAreSortedAtStart;
+ private Boolean nullsAreSortedAtEnd;
+ private String databaseProductName;
+ private String databaseProductVersion;
+ private String driverName;
+ private String driverVersion;
+ private Integer driverMajorVersion;
+ private Integer driverMinorVersion;
+ private Boolean usesLocalFiles;
+ private Boolean usesLocalFilePerTable;
+ private Boolean supportsMixedCaseIdentifiers;
+ private Boolean storesUpperCaseIdentifiers;
+ private Boolean storesLowerCaseIdentifiers;
+ private Boolean storesMixedCaseIdentifiers;
+ private Boolean supportsMixedCaseQuotedIdentifiers;
+ private Boolean storesUpperCaseQuotedIdentifiers;
+ private Boolean storesLowerCaseQuotedIdentifiers;
+ private Boolean storesMixedCaseQuotedIdentifiers;
+ private String identifierQuoteString;
+ private Set<String> sqlKeywords = new HashSet<String>();
+ private Set<String> numericFunctions = new HashSet<String>();
+ private Set<String> stringFunctions = new HashSet<String>();
+ private Set<String> systemFunctions = new HashSet<String>();
+ private Set<String> timeDateFunctions = new HashSet<String>();
+ private String searchStringEscape;
+ private String extraNameCharacters;
+ private Boolean supportsAlterTableWithAddColumn;
+ private Boolean supportsAlterTableWithDropColumn;
+ private Boolean supportsColumnAliasing;
+ private Boolean nullPlusNonNullIsNull;
+ private Boolean supportsConvert;
+ private Boolean supportsTableCorrelationNames;
+ private Boolean supportsDifferentTableCorrelationNames;
+ private Boolean supportsExpressionsInOrderBy;
+ private Boolean supportsOrderByUnrelated;
+ private Boolean supportsGroupBy;
+ private Boolean supportsGroupByUnrelated;
+ private Boolean supportsGroupByBeyondSelect;
+ private Boolean supportsLikeEscapeClause;
+ private Boolean supportsMultipleResultSets;
+ private Boolean supportsMultipleTransactions;
+ private Boolean supportsNonNullableColumns;
+ private Boolean supportsMinimumSQLGrammar;
+ private Boolean supportsCoreSQLGrammar;
+ private Boolean supportsExtendedSQLGrammar;
+ private Boolean supportsANSI92EntryLevelSQL;
+ private Boolean supportsANSI92IntermediateSQL;
+ private Boolean supportsANSI92FullSQL;
+ private Boolean supportsIntegrityEnhancementFacility;
+ private Boolean supportsOuterJoins;
+ private Boolean supportsFullOuterJoins;
+ private Boolean supportsLimitedOuterJoins;
+ private String schemaTerm;
+ private String procedureTerm;
+ private String catalogTerm;
+ private Boolean catalogAtStart;
+ private String �atalogSeparator;
+ private Boolean supportsSchemasInDataManipulation;
+ private Boolean supportsSchemasInProcedureCalls;
+ private Boolean supportsSchemasInTableDefinitions;
+ private Boolean supportsSchemasInIndexDefinitions;
+ private Boolean supportsSchemasInPrivilegeDefinitions;
+ private Boolean supportsCatalogsInDataManipulation;
+ private Boolean supportsCatalogsInProcedureCalls;
+ private Boolean supportsCatalogsInTableDefinitions;
+ private Boolean supportsCatalogsInIndexDefinitions;
+ private Boolean supportsCatalogsInPrivilegeDefinitions;
+ private Boolean supportsPositionedDelete;
+ private Boolean supportsPositionedUpdate;
+ private Boolean supportsSelectForUpdate;
+ private Boolean supportsStoredProcedures;
+ private Boolean supportsSubqueriesInComparisons;
+ private Boolean supportsSubqueriesInExists;
+ private Boolean supportsSubqueriesInIns;
+ private Boolean supportsSubqueriesInQuantifieds;
+ private Boolean supportsCorrelatedSubqueries;
+ private Boolean supportsUnion;
+ private Boolean supportsUnionAll;
+ private Boolean supportsOpenCursorsAcrossCommit;
+ private Boolean supportsOpenCursorsAcrossRollback;
+ private Boolean supportsOpenStatementsAcrossCommit;
+ private Boolean supportsOpenStatementsAcrossRollback;
+ private Integer maxBinaryLiteralLength;
+ private Integer maxCharLiteralLength;
+ private Integer maxColumnNameLength;
+ private Integer maxColumnsInGroupBy;
+ private Integer maxColumnsInIndex;
+ private Integer maxColumnsInOrderBy;
+ private Integer maxColumnsInSelect;
+ private Integer maxColumnsInTable;
+ private Integer maxConnections;
+ private Integer maxCursorNameLength;
+ private Integer maxIndexLength;
+ private Integer maxSchemaNameLength;
+ private Integer maxProcedureNameLength;
+ private Integer maxCatalogNameLength;
+ private Integer maxRowSize;
+ private Boolean maxRowSizeIncludeBlobs;
+ private Integer maxStatementLength;
+ private Integer maxStatements;
+ private Integer maxTableNameLength;
+ private Integer maxTablesInSelect;
+ private Integer maxUserNameLength;
+ private Integer defaultTransactionIsolation;
+ private Boolean supportsTransactions;
+ private Set<TransactionIsolationLevelType> supportedTransactionIsolationLevels = new HashSet<TransactionIsolationLevelType>();
+ private Boolean supportsDataDefinitionAndDataManipulationTransactions;
+ private Boolean supportsDataManipulationTransactionsOnly;
+ private Boolean dataDefinitionCausesTransactionCommit;
+ private Boolean dataDefinitionIgnoredInTransactions;
+ private Set<StoredProcedure> storedProcedures = new HashSet<StoredProcedure>();
+ private Set<Table> tables = new HashSet<Table>();
+ private Set<Schema> schemas = new HashSet<Schema>();
+ private Set<Catalog> catalogs = new HashSet<Catalog>();
+ private Set<TableType> tableTypes = new HashSet<TableType>();
+ private Set<SqlTypeInfo> sqlTypeInfos = new HashSet<SqlTypeInfo>();
+ private Set<ResultSetType> supportedResultSetTypes = new HashSet<ResultSetType>();
+ private Set<UserDefinedType> userDefinedTypes = new HashSet<UserDefinedType>();
+ private Set<SqlTypeConversionPair> supportedConversions = new HashSet<SqlTypeConversionPair>();
+ private Set<ResultSetConcurrencyType> supportedForwardOnlyResultSetConcurrencies = new HashSet<ResultSetConcurrencyType>();
+ private Set<ResultSetConcurrencyType> supportedScrollInsensitiveResultSetConcurrencies = new HashSet<ResultSetConcurrencyType>();
+ private Set<ResultSetConcurrencyType> supportedScrollSensitiveResultSetConcurrencies = new HashSet<ResultSetConcurrencyType>();
+ private Boolean forwardOnlyResultSetOwnUpdatesAreVisible;
+ private Boolean scrollInsensitiveResultSetOwnUpdatesAreVisible;
+ private Boolean scrollSensitiveResultSetOwnUpdatesAreVisible;
+ private Boolean forwardOnlyResultSetOwnDeletesAreVisible;
+ private Boolean scrollInsensitiveResultSetOwnDeletesAreVisible;
+ private Boolean scrollSensitiveResultSetOwnDeletesAreVisible;
+ private Boolean forwardOnlyResultSetOwnInsertsAreVisible;
+ private Boolean scrollInsensitiveResultSetOwnInsertsAreVisible;
+ private Boolean scrollSensitiveResultSetOwnInsertsAreVisible;
+ private Boolean forwardOnlyResultSetOthersUpdatesAreVisible;
+ private Boolean scrollInsensitiveResultSetOthersUpdatesAreVisible;
+ private Boolean scrollSensitiveResultSetOthersUpdatesAreVisible;
+ private Boolean forwardOnlyResultSetOthersDeletesAreVisible;
+ private Boolean scrollInsensitiveResultSetOthersDeletesAreVisible;
+ private Boolean scrollSensitiveResultSetOthersDeletesAreVisible;
+ private Boolean forwardOnlyResultSetOthersInsertsAreVisible;
+ private Boolean scrollInsensitiveResultSetOthersInsertsAreVisible;
+ private Boolean scrollSensitiveResultSetOthersInsertsAreVisible;
+ private Boolean forwardOnlyResultSetUpdatesAreDetected;
+ private Boolean scrollInsensitiveResultSetUpdatesAreDetected;
+ private Boolean scrollSensitiveResultSetUpdatesAreDetected;
+ private Boolean forwardOnlyResultSetDeletesAreDetected;
+ private Boolean scrollInsensitiveResultSetDeletesAreDetected;
+ private Boolean scrollSensitiveResultSetDeletesAreDetected;
+ private Boolean forwardOnlyResultInsertsAreDetected;
+ private Boolean scrollInsensitiveResultInsertsAreDetected;
+ private Boolean scrollSensitiveResultInsertsAreDetected;
+ private Boolean supportsBatchUpdates;
+ private Boolean supportsSavepoints;
+ private Boolean supportsNamedParameters;
+ private Boolean supportsMultipleOpenResults;
+ private Boolean supportsGetGeneratedKeys;
+ private Boolean supportsResultSetHoldCurrorsOverCommitHoldability;
+ private Boolean supportsResultSetCloseCurrorsAtCommitHoldability;
+ private ResultSetHoldabilityType resultSetHoldabilityType;
+ private Integer databaseMajorVersion;
+ private Integer databaseMinorVersion;
+ private Integer jdbcMajorVersion;
+ private Integer jdbcMinorVersion;
+ private SQLStateType sqlStateType;
+ private Boolean locatorsUpdateCopy;
+ private Boolean supportsStatementPooling;
+
+ /**
+ * Default constructor
+ */
+ public DatabaseBean() {
+ }
+
+ /**
+ * Returns list of failed database metadata methods through the DatabaseMetaDataMethodExceptions
+ *
+ * @return list of failed database metadata methods through the DatabaseMetaDataMethodExceptions
+ */
+ public List<DatabaseMetaDataMethodException> getExceptionList() {
+ return exceptionList;
+ }
+
+ /**
+ * Adds the DatabaseMetaDataMethodException to the DatabaseMetadataProvider exception list
+ *
+ * @param exception the DatabaseMetaDataMethodException
+ */
+ public void addException( DatabaseMetaDataMethodException exception ) {
+ exceptionList.add(exception);
+ }
+
+ /**
+ * Searches the DatabaseMetaDataMethodException by method name
+ *
+ * @param methodName the name of method that caused exception
+ * @return the DatabaseMetaDataMethodException if found, otherwise returns null
+ */
+ public DatabaseMetaDataMethodException findException( String methodName ) {
+ // trying to find exception
+ for (DatabaseMetaDataMethodException exception : exceptionList) {
+ if (exception.getMethodName().equals(methodName)) {
+ return exception;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Checks that specified database metadata method of provider is failed or not
+ *
+ * @param methodName the name of method that caused exception
+ * @return true if method failed; false otherwise
+ */
+ public boolean isDatabaseMetaDataMethodFailed( String methodName ) {
+ return (findException(methodName) != null);
+ }
+
+ /**
+ * Gets database name
+ *
+ * @return database name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets database name
+ *
+ * @param name the database name
+ */
+ public void setName( String name ) {
+ this.name = name;
+ }
+
+ // ----------------------------------------------------------------------
+ // A variety of minor information about the target database.
+ // ----------------------------------------------------------------------
+
+ /**
+ * Retrieves whether the current user can call all the procedures returned by the method
+ * <code>DatabaseMetaData.getProcedures</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isAllProceduresAreCallable() {
+ return allProceduresAreCallable;
+ }
+
+ /**
+ * sets whether the current user can call all the procedures returned by the method
+ * <code>DatabaseMetaData.getProcedures</code>.
+ *
+ * @param allProceduresAreCallable <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setAllProceduresAreCallable( Boolean allProceduresAreCallable ) {
+ this.allProceduresAreCallable = allProceduresAreCallable;
+ }
+
+ /**
+ * Retrieves whether the current user can use all the tables returned by the method <code>DatabaseMetaData.getTables</code> in
+ * a <code>SELECT</code> statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isAllTablesAreSelectable() {
+ return allTablesAreSelectable;
+ }
+
+ /**
+ * Sets whether the current user can use all the tables returned by the method <code>DatabaseMetaData.getTables</code> in a
+ * <code>SELECT</code> statement.
+ *
+ * @param allTablesAreSelectable <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setAllTablesAreSelectable( Boolean allTablesAreSelectable ) {
+ this.allTablesAreSelectable = allTablesAreSelectable;
+ }
+
+ /**
+ * Retrieves the URL for this DBMS.
+ *
+ * @return the URL for this DBMS or <code>null</code> if it cannot be generated
+ */
+ public String getURL() {
+ return url;
+ }
+
+ /**
+ * Sets the URL for this DBMS.
+ *
+ * @param url the URL for this DBMS or <code>null</code> if it cannot be generated
+ */
+ public void setURL( String url ) {
+ this.url = url;
+ }
+
+ /**
+ * Retrieves the user name as known to this database.
+ *
+ * @return the database user name
+ */
+ public String getUserName() {
+ return userName;
+ }
+
+ /**
+ * Sets the user name as known to this database.
+ *
+ * @param userName the database user name
+ */
+ public void setUserName( String userName ) {
+ this.userName = userName;
+ }
+
+ /**
+ * Retrieves whether this database is in read-only mode.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isReadOnly() {
+ return readOnly;
+ }
+
+ /**
+ * Sets whether this database is in read-only mode.
+ *
+ * @param readOnly <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setReadOnly( Boolean readOnly ) {
+ this.readOnly = readOnly;
+ }
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted high. Sorted high means that <code>NULL</code> values sort higher
+ * than any other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values
+ * will appear at the end. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtEnd</code> indicates whether
+ * <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isNullsAreSortedHigh() {
+ return nullsAreSortedHigh;
+ }
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted high. Sorted high means that <code>NULL</code> values sort higher than any
+ * other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the end. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtEnd</code> indicates whether
+ * <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @param nullsAreSortedHigh <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setNullsAreSortedHigh( Boolean nullsAreSortedHigh ) {
+ this.nullsAreSortedHigh = nullsAreSortedHigh;
+ }
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted low. Sorted low means that <code>NULL</code> values sort lower than
+ * any other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the beginning. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtStart</code> indicates whether
+ * <code>NULL</code> values are sorted at the beginning regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isNullsAreSortedLow() {
+ return nullsAreSortedLow;
+ }
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted low. Sorted low means that <code>NULL</code> values sort lower than any
+ * other value in a domain. In an ascending order, if this method returns <code>true</code>, <code>NULL</code> values will
+ * appear at the beginning. By contrast, the method <code>DatabaseMetaData.nullsAreSortedAtStart</code> indicates whether
+ * <code>NULL</code> values are sorted at the beginning regardless of sort order.
+ *
+ * @param nullsAreSortedLow <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setNullsAreSortedLow( Boolean nullsAreSortedLow ) {
+ this.nullsAreSortedLow = nullsAreSortedLow;
+ }
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted at the start regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isNullsAreSortedAtStart() {
+ return nullsAreSortedAtStart;
+ }
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted at the start regardless of sort order.
+ *
+ * @param nullsAreSortedAtStart <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setNullsAreSortedAtStart( Boolean nullsAreSortedAtStart ) {
+ this.nullsAreSortedAtStart = nullsAreSortedAtStart;
+ }
+
+ /**
+ * Retrieves whether <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isNullsAreSortedAtEnd() {
+ return nullsAreSortedAtEnd;
+ }
+
+ /**
+ * Sets whether <code>NULL</code> values are sorted at the end regardless of sort order.
+ *
+ * @param nullsAreSortedAtEnd <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setNullsAreSortedAtEnd( Boolean nullsAreSortedAtEnd ) {
+ this.nullsAreSortedAtEnd = nullsAreSortedAtEnd;
+ }
+
+ /**
+ * Retrieves the name of this database product.
+ *
+ * @return database product name
+ */
+ public String getDatabaseProductName() {
+ return databaseProductName;
+ }
+
+ /**
+ * Sets the name of this database product.
+ *
+ * @param databaseProductName database product name
+ */
+ public void setDatabaseProductName( String databaseProductName ) {
+ this.databaseProductName = databaseProductName;
+ }
+
+ /**
+ * Retrieves the version number of this database product.
+ *
+ * @return database version number
+ */
+ public String getDatabaseProductVersion() {
+ return databaseProductVersion;
+ }
+
+ /**
+ * Sets the version number of this database product.
+ *
+ * @param databaseProductVersion database version number
+ */
+ public void setDatabaseProductVersion( String databaseProductVersion ) {
+ this.databaseProductVersion = databaseProductVersion;
+ }
+
+ /**
+ * Retrieves the name of this JDBC driver.
+ *
+ * @return JDBC driver name
+ */
+ public String getDriverName() {
+ return driverName;
+ }
+
+ /**
+ * Sets the name of this JDBC driver.
+ *
+ * @param driverName JDBC driver name
+ */
+ public void setDriverName( String driverName ) {
+ this.driverName = driverName;
+ }
+
+ /**
+ * Retrieves the version number of this JDBC driver as a <code>String</code>.
+ *
+ * @return JDBC driver version
+ */
+ public String getDriverVersion() {
+ return driverVersion;
+ }
+
+ /**
+ * Sets the version number of this JDBC driver as a <code>String</code>.
+ *
+ * @param driverVersion the JDBC driver version
+ */
+ public void setDriverVersion( String driverVersion ) {
+ this.driverVersion = driverVersion;
+ }
+
+ /**
+ * Retrieves this JDBC driver's minor version number.
+ *
+ * @return JDBC driver minor version number
+ */
+ public Integer getDriverMajorVersion() {
+ return driverMajorVersion;
+ }
+
+ /**
+ * Sets this JDBC driver's major version number.
+ *
+ * @param driverMajorVersion the JDBC driver major version
+ */
+ public void setDriverMajorVersion( Integer driverMajorVersion ) {
+ this.driverMajorVersion = driverMajorVersion;
+ }
+
+ /**
+ * Retrieves this JDBC driver's minor version number.
+ *
+ * @return JDBC driver minor version number
+ */
+ public Integer getDriverMinorVersion() {
+ return driverMinorVersion;
+ }
+
+ /**
+ * Sets this JDBC driver's minor version number.
+ *
+ * @param driverMinorVersion the JDBC driver minor version number
+ */
+ public void setDriverMinorVersion( Integer driverMinorVersion ) {
+ this.driverMinorVersion = driverMinorVersion;
+ }
+
+ /**
+ * Retrieves whether this database stores tables in a local file.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isUsesLocalFiles() {
+ return usesLocalFiles;
+ }
+
+ /**
+ * Sets whether this database stores tables in a local file.
+ *
+ * @param usesLocalFiles <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setUsesLocalFiles( Boolean usesLocalFiles ) {
+ this.usesLocalFiles = usesLocalFiles;
+ }
+
+ /**
+ * Retrieves whether this database uses a file for each table.
+ *
+ * @return <code>true</code> if this database uses a local file for each table; <code>false</code> otherwise
+ */
+ public Boolean isUsesLocalFilePerTable() {
+ return usesLocalFilePerTable;
+ }
+
+ /**
+ * Sets whether this database uses a file for each table.
+ *
+ * @param usesLocalFilePerTable <code>true</code> if this database uses a local file for each table; <code>false</code>
+ * otherwise
+ */
+ public void setUsesLocalFilePerTable( Boolean usesLocalFilePerTable ) {
+ this.usesLocalFilePerTable = usesLocalFilePerTable;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsMixedCaseIdentifiers() {
+ return supportsMixedCaseIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @param supportsMixedCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsMixedCaseIdentifiers( Boolean supportsMixedCaseIdentifiers ) {
+ this.supportsMixedCaseIdentifiers = supportsMixedCaseIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in upper
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresUpperCaseIdentifiers() {
+ return storesUpperCaseIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @param storesUpperCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresUpperCaseIdentifiers( Boolean storesUpperCaseIdentifiers ) {
+ this.storesUpperCaseIdentifiers = storesUpperCaseIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in lower
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresLowerCaseIdentifiers() {
+ return storesLowerCaseIdentifiers;
+ }
+
+ /**
+ * sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @param storesLowerCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresLowerCaseIdentifiers( Boolean storesLowerCaseIdentifiers ) {
+ this.storesLowerCaseIdentifiers = storesLowerCaseIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in mixed
+ * case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresMixedCaseIdentifiers() {
+ return storesMixedCaseIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case unquoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @param storesMixedCaseIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresMixedCaseIdentifiers( Boolean storesMixedCaseIdentifiers ) {
+ this.storesMixedCaseIdentifiers = storesMixedCaseIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case sensitive and as a result stores them in
+ * mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsMixedCaseQuotedIdentifiers() {
+ return supportsMixedCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case sensitive and as a result stores them in mixed
+ * case.
+ *
+ * @param supportsMixedCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsMixedCaseQuotedIdentifiers( Boolean supportsMixedCaseQuotedIdentifiers ) {
+ this.supportsMixedCaseQuotedIdentifiers = supportsMixedCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresUpperCaseQuotedIdentifiers() {
+ return storesUpperCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in upper case.
+ *
+ * @param storesUpperCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresUpperCaseQuotedIdentifiers( Boolean storesUpperCaseQuotedIdentifiers ) {
+ this.storesUpperCaseQuotedIdentifiers = storesUpperCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresLowerCaseQuotedIdentifiers() {
+ return storesLowerCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in lower case.
+ *
+ * @param storesLowerCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresLowerCaseQuotedIdentifiers( Boolean storesLowerCaseQuotedIdentifiers ) {
+ this.storesLowerCaseQuotedIdentifiers = storesLowerCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Retrieves whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isStoresMixedCaseQuotedIdentifiers() {
+ return storesMixedCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Sets whether this database treats mixed case quoted SQL identifiers as case insensitive and stores them in mixed case.
+ *
+ * @param storesMixedCaseQuotedIdentifiers <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setStoresMixedCaseQuotedIdentifiers( Boolean storesMixedCaseQuotedIdentifiers ) {
+ this.storesMixedCaseQuotedIdentifiers = storesMixedCaseQuotedIdentifiers;
+ }
+
+ /**
+ * Retrieves the string used to quote SQL identifiers. This method returns a space " " if identifier quoting is not supported.
+ *
+ * @return the quoting string or a space if quoting is not supported
+ */
+ public String getIdentifierQuoteString() {
+ return identifierQuoteString;
+ }
+
+ /**
+ * Sets the string used to quote SQL identifiers. This method returns a space " " if identifier quoting is not supported.
+ *
+ * @param identifierQuoteString the quoting string or a space if quoting is not supported
+ */
+ public void setIdentifierQuoteString( String identifierQuoteString ) {
+ this.identifierQuoteString = identifierQuoteString;
+ }
+
+ /**
+ * Retrieves a list of all of this database's SQL keywords that are NOT also SQL92 keywords.
+ *
+ * @return the list of this database's keywords that are not also SQL92 keywords
+ */
+ public Set<String> getSQLKeywords() {
+ return sqlKeywords;
+ }
+
+ /**
+ * Adds SQL keyword
+ *
+ * @param sqlKeyword the SQL keyword to add
+ */
+ public void addSQLKeyword( String sqlKeyword ) {
+ sqlKeywords.add(sqlKeyword);
+ }
+
+ /**
+ * Deletes SQL keyword
+ *
+ * @param sqlKeyword the SQL keyword to delete
+ */
+ public void deleteSQLKeyword( String sqlKeyword ) {
+ sqlKeywords.remove(sqlKeyword);
+ }
+
+ /**
+ * Is SQL keyword supported
+ *
+ * @param sqlKeyword the SQL keyword to search
+ * @return true if supported; false otherwiose
+ */
+ public Boolean isSQLKeywordSupported( String sqlKeyword ) {
+ for (String s : sqlKeywords) {
+ if (s.equals(sqlKeyword)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves a list of math functions available with this database. These are the Open /Open CLI math function names used in
+ * the JDBC function escape clause.
+ *
+ * @return the list of math functions supported by this database
+ */
+ public Set<String> getNumericFunctions() {
+ return numericFunctions;
+ }
+
+ /**
+ * Adds numeric function
+ *
+ * @param functionName the name of numeric function to add
+ */
+ public void addNumericFunction( String functionName ) {
+ numericFunctions.add(functionName);
+ }
+
+ /**
+ * Deletes numeric function
+ *
+ * @param functionName the name of numeric function to delete
+ */
+ public void deleteNumericFunction( String functionName ) {
+ numericFunctions.remove(functionName);
+ }
+
+ /**
+ * Is Numeric function supported
+ *
+ * @param functionName the name of numeric function
+ * @return true is supported; false otherwise
+ */
+ public Boolean isNumericFunctionSupported( String functionName ) {
+ for (String s : numericFunctions) {
+ if (s.equals(functionName)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves a list of string functions available with this database. These are the Open Group CLI string function names used
+ * in the JDBC function escape clause.
+ *
+ * @return the list of string functions supported by this database
+ */
+ public Set<String> getStringFunctions() {
+ return stringFunctions;
+ }
+
+ /**
+ * Adds String function
+ *
+ * @param functionName the name of String function to add
+ */
+ public void addStringFunction( String functionName ) {
+ stringFunctions.add(functionName);
+ }
+
+ /**
+ * Deletes String function
+ *
+ * @param functionName the name of String function to delete
+ */
+ public void deleteStringFunction( String functionName ) {
+ stringFunctions.remove(functionName);
+ }
+
+ /**
+ * Is String function supported
+ *
+ * @param functionName the name of String function
+ * @return true is supported; false otherwise
+ */
+ public Boolean isStringFunctionSupported( String functionName ) {
+ for (String s : stringFunctions) {
+ if (s.equals(functionName)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves a list of system functions available with this database. These are the Open Group CLI system function names used
+ * in the JDBC function escape clause.
+ *
+ * @return a list of system functions supported by this database
+ */
+ public Set<String> getSystemFunctions() {
+ return systemFunctions;
+ }
+
+ /**
+ * Adds System function
+ *
+ * @param functionName the name of System function to add
+ */
+ public void addSystemFunction( String functionName ) {
+ systemFunctions.add(functionName);
+ }
+
+ /**
+ * deletes System function
+ *
+ * @param functionName the name of System function to delete
+ */
+ public void deleteSystemFunction( String functionName ) {
+ systemFunctions.remove(functionName);
+ }
+
+ /**
+ * Is System function supported
+ *
+ * @param functionName the name of System function
+ * @return true is supported; false otherwise
+ */
+ public Boolean isSystemFunctionSupported( String functionName ) {
+ for (String s : systemFunctions) {
+ if (s.equals(functionName)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves a list of the time and date functions available with this database.
+ *
+ * @return the list of time and date functions supported by this database
+ */
+ public Set<String> getTimeDateFunctions() {
+ return timeDateFunctions;
+ }
+
+ /**
+ * Adds Time/Date function
+ *
+ * @param functionName the name of Time/Date function to add
+ */
+ public void addTimeDateFunction( String functionName ) {
+ timeDateFunctions.add(functionName);
+ }
+
+ /**
+ * deletes Time/Date function
+ *
+ * @param functionName the name of Time/Date function to delete
+ */
+ public void deleteTimeDateFunction( String functionName ) {
+ timeDateFunctions.remove(functionName);
+ }
+
+ /**
+ * Is Time/Date function supported
+ *
+ * @param functionName the name of Time/Date function
+ * @return true is supported; false otherwise
+ */
+ public Boolean isTimeDateFunctionSupported( String functionName ) {
+ for (String s : timeDateFunctions) {
+ if (s.equals(functionName)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or
+ * '%' in the catalog search parameters that are a pattern (and therefore use one of the wildcard characters).
+ * <P>
+ * The '_' character represents any single character; the '%' character represents any sequence of zero or more characters.
+ *
+ * @return the string used to escape wildcard characters
+ */
+ public String getSearchStringEscape() {
+ return searchStringEscape;
+ }
+
+ /**
+ * Sets the string that can be used to escape wildcard characters. This is the string that can be used to escape '_' or '%' in
+ * the catalog search parameters that are a pattern (and therefore use one of the wildcard characters).
+ * <P>
+ * The '_' character represents any single character; the '%' character represents any sequence of zero or more characters.
+ *
+ * @param searchStringEscape the string used to escape wildcard characters
+ */
+ public void setSearchStringEscape( String searchStringEscape ) {
+ this.searchStringEscape = searchStringEscape;
+ }
+
+ /**
+ * Retrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
+ *
+ * @return the string containing the extra characters
+ */
+ public String getExtraNameCharacters() {
+ return extraNameCharacters;
+ }
+
+ /**
+ * Sets all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).
+ *
+ * @param extraNameCharacters the string containing the extra characters
+ */
+ public void setExtraNameCharacters( String extraNameCharacters ) {
+ this.extraNameCharacters = extraNameCharacters;
+ }
+
+ // --------------------------------------------------------------------
+ // Functions describing which features are supported.
+ // --------------------------------------------------------------------
+
+ /**
+ * Retrieves whether this database supports <code>ALTER TABLE</code> with add column.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsAlterTableWithAddColumn() {
+ return supportsAlterTableWithAddColumn;
+ }
+
+ /**
+ * Sets whether this database supports <code>ALTER TABLE</code> with add column.
+ *
+ * @param supportsAlterTableWithAddColumn <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsAlterTableWithAddColumn( Boolean supportsAlterTableWithAddColumn ) {
+ this.supportsAlterTableWithAddColumn = supportsAlterTableWithAddColumn;
+ }
+
+ /**
+ * Retrieves whether this database supports <code>ALTER TABLE</code> with drop column.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsAlterTableWithDropColumn() {
+ return supportsAlterTableWithDropColumn;
+ }
+
+ /**
+ * Sets whether this database supports <code>ALTER TABLE</code> with drop column.
+ *
+ * @param supportsAlterTableWithDropColumn <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsAlterTableWithDropColumn( Boolean supportsAlterTableWithDropColumn ) {
+ this.supportsAlterTableWithDropColumn = supportsAlterTableWithDropColumn;
+ }
+
+ /**
+ * Retrieves whether this database supports column aliasing.
+ * <P>
+ * If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as
+ * required.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsColumnAliasing() {
+ return supportsColumnAliasing;
+ }
+
+ /**
+ * Sets whether this database supports column aliasing.
+ * <P>
+ * If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as
+ * required.
+ *
+ * @param supportsColumnAliasing <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsColumnAliasing( Boolean supportsColumnAliasing ) {
+ this.supportsColumnAliasing = supportsColumnAliasing;
+ }
+
+ /**
+ * Retrieves whether this database supports concatenations between <code>NULL</code> and non-<code>NULL</code> values being
+ * <code>NULL</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isNullPlusNonNullIsNull() {
+ return nullPlusNonNullIsNull;
+ }
+
+ /**
+ * Sets whether this database supports concatenations between <code>NULL</code> and non-<code>NULL</code> values being
+ * <code>NULL</code>.
+ * @param nullPlusNonNullIsNull true if so
+ *
+ */
+ public void setNullPlusNonNullIsNull( Boolean nullPlusNonNullIsNull ) {
+ this.nullPlusNonNullIsNull = nullPlusNonNullIsNull;
+ }
+
+ /**
+ * Retrieves whether this database supports the <code>CONVERT</code> function between SQL types.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsConvert() {
+ return supportsConvert;
+ }
+
+ /**
+ * Sets whether this database supports the <code>CONVERT</code> function between SQL types.
+ *
+ * @param supportsConvert <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsConvert( Boolean supportsConvert ) {
+ this.supportsConvert = supportsConvert;
+ }
+
+ /**
+ * Retrieves whether this database supports the <code>CONVERT</code> for given SQL types. It uses original
+ * <code>DatabaseMetaData.supportsConvert</code> to check common (NOT ALL POSSIBLE) conversions.
+ *
+ * @return list of common (NOT ALL POSSIBLE) conversions.
+ * @see java.sql.Types
+ */
+ public Set<SqlTypeConversionPair> getSupportedConversions() {
+ return supportedConversions;
+ }
+
+ /**
+ * Adds SqlTypeConversionPair
+ *
+ * @param sqlTypeConversionPair the SqlTypeConversionPair
+ */
+ public void addSqlTypeConversionPair( SqlTypeConversionPair sqlTypeConversionPair ) {
+ supportedConversions.add(sqlTypeConversionPair);
+ }
+
+ /**
+ * deletes SqlTypeConversionPair
+ *
+ * @param sqlTypeConversionPair the SqlTypeConversionPair
+ */
+ public void deleteSqlTypeConversionPair( SqlTypeConversionPair sqlTypeConversionPair ) {
+ supportedConversions.remove(sqlTypeConversionPair);
+ }
+
+ /**
+ * Searches set of SqlTypeConversionPair by SrcType
+ * @param srcType
+ *
+ * @return set of SqlTypeConversionPair
+ */
+ public Set<SqlTypeConversionPair> findSqlTypeConversionPairBySrcType( String srcType ) {
+ // create set holder
+ Set<SqlTypeConversionPair> set = new HashSet<SqlTypeConversionPair>();
+ // if found
+ for (SqlTypeConversionPair c : supportedConversions) {
+ if (c.getSrcType().toString().equals(srcType)) {
+ set.add(c);
+ }
+ }
+ // return nothing
+ return set;
+ }
+
+ /**
+ * Retrieves whether this database supports table correlation names.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsTableCorrelationNames() {
+ return supportsTableCorrelationNames;
+ }
+
+ /**
+ * Sets whether this database supports table correlation names.
+ *
+ * @param supportsTableCorrelationNames <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsTableCorrelationNames( Boolean supportsTableCorrelationNames ) {
+ this.supportsTableCorrelationNames = supportsTableCorrelationNames;
+ }
+
+ /**
+ * Retrieves whether, when table correlation names are supported, they are restricted to being different from the names of the
+ * tables.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsDifferentTableCorrelationNames() {
+ return supportsDifferentTableCorrelationNames;
+ }
+
+ /**
+ * Sets whether, when table correlation names are supported, they are restricted to being different from the names of the
+ * tables.
+ *
+ * @param supportsDifferentTableCorrelationNames <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsDifferentTableCorrelationNames( Boolean supportsDifferentTableCorrelationNames ) {
+ this.supportsDifferentTableCorrelationNames = supportsDifferentTableCorrelationNames;
+ }
+
+ /**
+ * Retrieves whether this database supports expressions in <code>ORDER BY</code> lists.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsExpressionsInOrderBy() {
+ return supportsExpressionsInOrderBy;
+ }
+
+ /**
+ * Sets whether this database supports expressions in <code>ORDER BY</code> lists.
+ *
+ * @param supportsExpressionsInOrderBy <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsExpressionsInOrderBy( Boolean supportsExpressionsInOrderBy ) {
+ this.supportsExpressionsInOrderBy = supportsExpressionsInOrderBy;
+ }
+
+ /**
+ * Retrieves whether this database supports using a column that is not in the <code>SELECT</code> statement in an
+ * <code>ORDER BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsOrderByUnrelated() {
+ return supportsOrderByUnrelated;
+ }
+
+ /**
+ * Sets whether this database supports using a column that is not in the <code>SELECT</code> statement in an
+ * <code>ORDER BY</code> clause.
+ * @param supportsOrderByUnrelated true if so
+ *
+ */
+ public void setSupportsOrderByUnrelated( Boolean supportsOrderByUnrelated ) {
+ this.supportsOrderByUnrelated = supportsOrderByUnrelated;
+ }
+
+ /**
+ * Retrieves whether this database supports some form of <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsGroupBy() {
+ return supportsGroupBy;
+ }
+
+ /**
+ * Sets whether this database supports some form of <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupBy <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsGroupBy( Boolean supportsGroupBy ) {
+ this.supportsGroupBy = supportsGroupBy;
+ }
+
+ /**
+ * Retrieves whether this database supports using a column that is not in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsGroupByUnrelated() {
+ return supportsGroupByUnrelated;
+ }
+
+ /**
+ * Sets whether this database supports using a column that is not in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupByUnrelated <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsGroupByUnrelated( Boolean supportsGroupByUnrelated ) {
+ this.supportsGroupByUnrelated = supportsGroupByUnrelated;
+ }
+
+ /**
+ * Retrieves whether this database supports using columns not included in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause provided that all of the columns in the <code>SELECT</code> statement are included in the
+ * <code>GROUP BY</code> clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsGroupByBeyondSelect() {
+ return supportsGroupByBeyondSelect;
+ }
+
+ /**
+ * Sets whether this database supports using columns not included in the <code>SELECT</code> statement in a
+ * <code>GROUP BY</code> clause provided that all of the columns in the <code>SELECT</code> statement are included in the
+ * <code>GROUP BY</code> clause.
+ *
+ * @param supportsGroupByBeyondSelect <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsGroupByBeyondSelect( Boolean supportsGroupByBeyondSelect ) {
+ this.supportsGroupByBeyondSelect = supportsGroupByBeyondSelect;
+ }
+
+ /**
+ * Retrieves whether this database supports specifying a <code>LIKE</code> escape clause.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsLikeEscapeClause() {
+ return supportsLikeEscapeClause;
+ }
+
+ /**
+ * Sets whether this database supports specifying a <code>LIKE</code> escape clause.
+ *
+ * @param supportsLikeEscapeClause <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsLikeEscapeClause( Boolean supportsLikeEscapeClause ) {
+ this.supportsLikeEscapeClause = supportsLikeEscapeClause;
+ }
+
+ /**
+ * Retrieves whether this database supports getting multiple <code>ResultSet</code> objects from a single call to the method
+ * <code>execute</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsMultipleResultSets() {
+ return supportsMultipleResultSets;
+ }
+
+ /**
+ * Sets whether this database supports getting multiple <code>ResultSet</code> objects from a single call to the method
+ * <code>execute</code>.
+ *
+ * @param supportsMultipleResultSets <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsMultipleResultSets( Boolean supportsMultipleResultSets ) {
+ this.supportsMultipleResultSets = supportsMultipleResultSets;
+ }
+
+ /**
+ * Retrieves whether this database allows having multiple transactions open at once (on different connections).
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsMultipleTransactions() {
+ return supportsMultipleTransactions;
+ }
+
+ /**
+ * Sets whether this database allows having multiple transactions open at once (on different connections).
+ *
+ * @param supportsMultipleTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsMultipleTransactions( Boolean supportsMultipleTransactions ) {
+ this.supportsMultipleTransactions = supportsMultipleTransactions;
+ }
+
+ /**
+ * Retrieves whether columns in this database may be defined as non-nullable.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsNonNullableColumns() {
+ return supportsNonNullableColumns;
+ }
+
+ /**
+ * Sets whether columns in this database may be defined as non-nullable.
+ *
+ * @param supportsNonNullableColumns <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsNonNullableColumns( Boolean supportsNonNullableColumns ) {
+ this.supportsNonNullableColumns = supportsNonNullableColumns;
+ }
+
+ /**
+ * Retrieves whether this database supports the ODBC Minimum SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsMinimumSQLGrammar() {
+ return supportsMinimumSQLGrammar;
+ }
+
+ /**
+ * Sets whether this database supports the ODBC Minimum SQL grammar.
+ *
+ * @param supportsMinimumSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsMinimumSQLGrammar( Boolean supportsMinimumSQLGrammar ) {
+ this.supportsMinimumSQLGrammar = supportsMinimumSQLGrammar;
+ }
+
+ /**
+ * Retrieves whether this database supports the ODBC Core SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCoreSQLGrammar() {
+ return supportsCoreSQLGrammar;
+ }
+
+ /**
+ * Sets whether this database supports the ODBC Core SQL grammar.
+ *
+ * @param supportsCoreSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCoreSQLGrammar( Boolean supportsCoreSQLGrammar ) {
+ this.supportsCoreSQLGrammar = supportsCoreSQLGrammar;
+ }
+
+ /**
+ * Retrieves whether this database supports the ODBC Extended SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsExtendedSQLGrammar() {
+ return supportsExtendedSQLGrammar;
+ }
+
+ /**
+ * Sets whether this database supports the ODBC Extended SQL grammar.
+ *
+ * @param supportsExtendedSQLGrammar <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsExtendedSQLGrammar( Boolean supportsExtendedSQLGrammar ) {
+ this.supportsExtendedSQLGrammar = supportsExtendedSQLGrammar;
+ }
+
+ /**
+ * Retrieves whether this database supports the ANSI92 entry level SQL grammar.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsANSI92EntryLevelSQL() {
+ return supportsANSI92EntryLevelSQL;
+ }
+
+ /**
+ * Sets whether this database supports the ANSI92 entry level SQL grammar.
+ *
+ * @param supportsANSI92EntryLevelSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsANSI92EntryLevelSQL( Boolean supportsANSI92EntryLevelSQL ) {
+ this.supportsANSI92EntryLevelSQL = supportsANSI92EntryLevelSQL;
+ }
+
+ /**
+ * Retrieves whether this database supports the ANSI92 intermediate SQL grammar supported.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsANSI92IntermediateSQL() {
+ return supportsANSI92IntermediateSQL;
+ }
+
+ /**
+ * Sets whether this database supports the ANSI92 intermediate SQL grammar supported.
+ *
+ * @param supportsANSI92IntermediateSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsANSI92IntermediateSQL( Boolean supportsANSI92IntermediateSQL ) {
+ this.supportsANSI92IntermediateSQL = supportsANSI92IntermediateSQL;
+ }
+
+ /**
+ * Retrieves whether this database supports the ANSI92 full SQL grammar supported.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsANSI92FullSQL() {
+ return supportsANSI92FullSQL;
+ }
+
+ /**
+ * Sets whether this database supports the ANSI92 full SQL grammar supported.
+ *
+ * @param supportsANSI92FullSQL <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsANSI92FullSQL( Boolean supportsANSI92FullSQL ) {
+ this.supportsANSI92FullSQL = supportsANSI92FullSQL;
+ }
+
+ /**
+ * Retrieves whether this database supports the SQL Integrity Enhancement Facility.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsIntegrityEnhancementFacility() {
+ return supportsIntegrityEnhancementFacility;
+ }
+
+ /**
+ * Sets whether this database supports the SQL Integrity Enhancement Facility.
+ *
+ * @param supportsIntegrityEnhancementFacility <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsIntegrityEnhancementFacility( Boolean supportsIntegrityEnhancementFacility ) {
+ this.supportsIntegrityEnhancementFacility = supportsIntegrityEnhancementFacility;
+ }
+
+ /**
+ * Retrieves whether this database supports some form of outer join.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsOuterJoins() {
+ return supportsOuterJoins;
+ }
+
+ /**
+ * Sets whether this database supports some form of outer join.
+ *
+ * @param supportsOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsOuterJoins( Boolean supportsOuterJoins ) {
+ this.supportsOuterJoins = supportsOuterJoins;
+ }
+
+ /**
+ * Retrieves whether this database supports full nested outer joins.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsFullOuterJoins() {
+ return supportsFullOuterJoins;
+ }
+
+ /**
+ * Sets whether this database supports full nested outer joins.
+ *
+ * @param supportsFullOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsFullOuterJoins( Boolean supportsFullOuterJoins ) {
+ this.supportsFullOuterJoins = supportsFullOuterJoins;
+ }
+
+ /**
+ * Retrieves whether this database provides limited support for outer joins. (This will be <code>true</code> if the method
+ * <code>DatabaseMetaData.supportsFullOuterJoins</code> returns <code>true</code>).
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsLimitedOuterJoins() {
+ return supportsLimitedOuterJoins;
+ }
+
+ /**
+ * Sets whether this database provides limited support for outer joins. (This will be <code>true</code> if the method
+ * <code>DatabaseMetaData.supportsFullOuterJoins</code> returns <code>true</code>).
+ *
+ * @param supportsLimitedOuterJoins <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsLimitedOuterJoins( Boolean supportsLimitedOuterJoins ) {
+ this.supportsLimitedOuterJoins = supportsLimitedOuterJoins;
+ }
+
+ /**
+ * Retrieves the database vendor's preferred term for "schema".
+ *
+ * @return the vendor term for "schema"
+ */
+ public String getSchemaTerm() {
+ return schemaTerm;
+ }
+
+ /**
+ * Sets the database vendor's preferred term for "schema".
+ *
+ * @param schemaTerm the vendor term for "schema"
+ */
+ public void setSchemaTerm( String schemaTerm ) {
+ this.schemaTerm = schemaTerm;
+ }
+
+ /**
+ * Retrieves the database vendor's preferred term for "procedure".
+ *
+ * @return the vendor term for "procedure"
+ */
+ public String getProcedureTerm() {
+ return procedureTerm;
+ }
+
+ /**
+ * Sets the database vendor's preferred term for "procedure".
+ *
+ * @param procedureTerm the vendor term for "procedure"
+ */
+ public void setProcedureTerm( String procedureTerm ) {
+ this.procedureTerm = procedureTerm;
+ }
+
+ /**
+ * Retrieves the database vendor's preferred term for "catalog".
+ *
+ * @return the vendor term for "catalog"
+ */
+ public String getCatalogTerm() {
+ return catalogTerm;
+ }
+
+ /**
+ * Sets the database vendor's preferred term for "catalog".
+ *
+ * @param catalogTerm the vendor term for "catalog"
+ */
+ public void setCatalogTerm( String catalogTerm ) {
+ this.catalogTerm = catalogTerm;
+ }
+
+ /**
+ * Retrieves whether a catalog appears at the start of a fully qualified table name. If not, the catalog appears at the end.
+ *
+ * @return <code>true</code> if the catalog name appears at the beginning of a fully qualified table name; <code>false</code>
+ * otherwise
+ */
+ public Boolean isCatalogAtStart() {
+ return catalogAtStart;
+ }
+
+ /**
+ * Sets whether a catalog appears at the start of a fully qualified table name. If not, the catalog appears at the end.
+ *
+ * @param catalogAtStart <code>true</code> if the catalog name appears at the beginning of a fully qualified table name;
+ * <code>false</code> otherwise
+ */
+ public void setCatalogAtStart( Boolean catalogAtStart ) {
+ this.catalogAtStart = catalogAtStart;
+ }
+
+ /**
+ * Retrieves the <code>String</code> that this database uses as the separator between a catalog and table name.
+ *
+ * @return the separator string
+ */
+ public String getCatalogSeparator() {
+ return �atalogSeparator;
+ }
+
+ /**
+ * Sets the <code>String</code> that this database uses as the separator between a catalog and table name.
+ *
+ * @param catalogSeparator the separator string
+ */
+ public void setCatalogSeparator( String catalogSeparator ) {
+ this.�atalogSeparator = catalogSeparator;
+ }
+
+ /**
+ * Retrieves whether a schema name can be used in a data manipulation statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSchemasInDataManipulation() {
+ return supportsSchemasInDataManipulation;
+ }
+
+ /**
+ * Sets whether a schema name can be used in a data manipulation statement.
+ *
+ * @param supportsSchemasInDataManipulation <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSchemasInDataManipulation( Boolean supportsSchemasInDataManipulation ) {
+ this.supportsSchemasInDataManipulation = supportsSchemasInDataManipulation;
+ }
+
+ /**
+ * Retrieves whether a schema name can be used in a procedure call statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSchemasInProcedureCalls() {
+ return supportsSchemasInProcedureCalls;
+ }
+
+ /**
+ * Sets whether a schema name can be used in a procedure call statement.
+ *
+ * @param supportsSchemasInProcedureCalls <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSchemasInProcedureCalls( Boolean supportsSchemasInProcedureCalls ) {
+ this.supportsSchemasInProcedureCalls = supportsSchemasInProcedureCalls;
+ }
+
+ /**
+ * Retrieves whether a schema name can be used in a table definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSchemasInTableDefinitions() {
+ return supportsSchemasInTableDefinitions;
+ }
+
+ /**
+ * Sets whether a schema name can be used in a table definition statement.
+ *
+ * @param supportsSchemasInTableDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSchemasInTableDefinitions( Boolean supportsSchemasInTableDefinitions ) {
+ this.supportsSchemasInTableDefinitions = supportsSchemasInTableDefinitions;
+ }
+
+ /**
+ * Retrieves whether a schema name can be used in an index definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSchemasInIndexDefinitions() {
+ return supportsSchemasInIndexDefinitions;
+ }
+
+ /**
+ * Sets whether a schema name can be used in an index definition statement.
+ *
+ * @param supportsSchemasInIndexDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSchemasInIndexDefinitions( Boolean supportsSchemasInIndexDefinitions ) {
+ this.supportsSchemasInIndexDefinitions = supportsSchemasInIndexDefinitions;
+ }
+
+ /**
+ * Retrieves whether a schema name can be used in a privilege definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSchemasInPrivilegeDefinitions() {
+ return supportsSchemasInPrivilegeDefinitions;
+ }
+
+ /**
+ * Sets whether a schema name can be used in a privilege definition statement.
+ *
+ * @param supportsSchemasInPrivilegeDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSchemasInPrivilegeDefinitions( Boolean supportsSchemasInPrivilegeDefinitions ) {
+ this.supportsSchemasInPrivilegeDefinitions = supportsSchemasInPrivilegeDefinitions;
+ }
+
+ /**
+ * Retrieves whether a catalog name can be used in a data manipulation statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCatalogsInDataManipulation() {
+ return supportsCatalogsInDataManipulation;
+ }
+
+ /**
+ * Sets whether a catalog name can be used in a data manipulation statement.
+ *
+ * @param supportsCatalogsInDataManipulation <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCatalogsInDataManipulation( Boolean supportsCatalogsInDataManipulation ) {
+ this.supportsCatalogsInDataManipulation = supportsCatalogsInDataManipulation;
+ }
+
+ /**
+ * Retrieves whether a catalog name can be used in a procedure call statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCatalogsInProcedureCalls() {
+ return supportsCatalogsInProcedureCalls;
+ }
+
+ /**
+ * Sets whether a catalog name can be used in a procedure call statement.
+ *
+ * @param supportsCatalogsInProcedureCalls <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCatalogsInProcedureCalls( Boolean supportsCatalogsInProcedureCalls ) {
+ this.supportsCatalogsInProcedureCalls = supportsCatalogsInProcedureCalls;
+ }
+
+ /**
+ * Retrieves whether a catalog name can be used in a table definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCatalogsInTableDefinitions() {
+ return supportsCatalogsInTableDefinitions;
+ }
+
+ /**
+ * Sets whether a catalog name can be used in a table definition statement.
+ *
+ * @param supportsCatalogsInTableDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCatalogsInTableDefinitions( Boolean supportsCatalogsInTableDefinitions ) {
+ this.supportsCatalogsInTableDefinitions = supportsCatalogsInTableDefinitions;
+ }
+
+ /**
+ * Retrieves whether a catalog name can be used in an index definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCatalogsInIndexDefinitions() {
+ return supportsCatalogsInIndexDefinitions;
+ }
+
+ /**
+ * Sets whether a catalog name can be used in an index definition statement.
+ *
+ * @param supportsCatalogsInIndexDefinitions <code>true</code> if so; <code>false</code> otherwise
+ *
+ */
+ public void setSupportsCatalogsInIndexDefinitions( Boolean supportsCatalogsInIndexDefinitions ) {
+ this.supportsCatalogsInIndexDefinitions = supportsCatalogsInIndexDefinitions;
+ }
+
+ /**
+ * Retrieves whether a catalog name can be used in a privilege definition statement.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCatalogsInPrivilegeDefinitions() {
+ return supportsCatalogsInPrivilegeDefinitions;
+ }
+
+ /**
+ * Sets whether a catalog name can be used in a privilege definition statement.
+ *
+ * @param supportsCatalogsInPrivilegeDefinitions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCatalogsInPrivilegeDefinitions( Boolean supportsCatalogsInPrivilegeDefinitions ) {
+ this.supportsCatalogsInPrivilegeDefinitions = supportsCatalogsInPrivilegeDefinitions;
+ }
+
+ /**
+ * Retrieves whether this database supports positioned <code>DELETE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsPositionedDelete() {
+ return supportsPositionedDelete;
+ }
+
+ /**
+ * Sets whether this database supports positioned <code>DELETE</code> statements.
+ *
+ * @param supportsPositionedDelete <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsPositionedDelete( Boolean supportsPositionedDelete ) {
+ this.supportsPositionedDelete = supportsPositionedDelete;
+ }
+
+ /**
+ * Retrieves whether this database supports positioned <code>UPDATE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsPositionedUpdate() {
+ return supportsPositionedUpdate;
+ }
+
+ /**
+ * Sets whether this database supports positioned <code>UPDATE</code> statements.
+ *
+ * @param supportsPositionedUpdate <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsPositionedUpdate( Boolean supportsPositionedUpdate ) {
+ this.supportsPositionedUpdate = supportsPositionedUpdate;
+ }
+
+ /**
+ * Retrieves whether this database supports <code>SELECT FOR UPDATE</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSelectForUpdate() {
+ return supportsSelectForUpdate;
+ }
+
+ /**
+ * Sets whether this database supports <code>SELECT FOR UPDATE</code> statements.
+ *
+ * @param supportsSelectForUpdate <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSelectForUpdate( Boolean supportsSelectForUpdate ) {
+ this.supportsSelectForUpdate = supportsSelectForUpdate;
+ }
+
+ /**
+ * Retrieves whether this database supports stored procedure calls that use the stored procedure escape syntax.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsStoredProcedures() {
+ return supportsStoredProcedures;
+ }
+
+ /**
+ * Sets whether this database supports stored procedure calls that use the stored procedure escape syntax.
+ *
+ * @param supportsStoredProcedures <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsStoredProcedures( Boolean supportsStoredProcedures ) {
+ this.supportsStoredProcedures = supportsStoredProcedures;
+ }
+
+ /**
+ * Retrieves whether this database supports subqueries in comparison expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSubqueriesInComparisons() {
+ return supportsSubqueriesInComparisons;
+ }
+
+ /**
+ * Retrieves whether this database supports subqueries in comparison expressions.
+ *
+ * @param supportsSubqueriesInComparisons <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSubqueriesInComparisons( Boolean supportsSubqueriesInComparisons ) {
+ this.supportsSubqueriesInComparisons = supportsSubqueriesInComparisons;
+ }
+
+ /**
+ * Retrieves whether this database supports subqueries in <code>EXISTS</code> expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSubqueriesInExists() {
+ return supportsSubqueriesInExists;
+ }
+
+ /**
+ * Sets whether this database supports subqueries in <code>EXISTS</code> expressions.
+ *
+ * @param supportsSubqueriesInExists <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSubqueriesInExists( Boolean supportsSubqueriesInExists ) {
+ this.supportsSubqueriesInExists = supportsSubqueriesInExists;
+ }
+
+ /**
+ * Retrieves whether this database supports subqueries in <code>IN</code> statements.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSubqueriesInIns() {
+ return supportsSubqueriesInIns;
+ }
+
+ /**
+ * Sets whether this database supports subqueries in <code>IN</code> statements.
+ *
+ * @param supportsSubqueriesInIns <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSubqueriesInIns( Boolean supportsSubqueriesInIns ) {
+ this.supportsSubqueriesInIns = supportsSubqueriesInIns;
+ }
+
+ /**
+ * Retrieves whether this database supports subqueries in quantified expressions.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsSubqueriesInQuantifieds() {
+ return supportsSubqueriesInQuantifieds;
+ }
+
+ /**
+ * Sets whether this database supports subqueries in quantified expressions.
+ *
+ * @param supportsSubqueriesInQuantifieds <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsSubqueriesInQuantifieds( Boolean supportsSubqueriesInQuantifieds ) {
+ this.supportsSubqueriesInQuantifieds = supportsSubqueriesInQuantifieds;
+ }
+
+ /**
+ * Retrieves whether this database supports correlated subqueries.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsCorrelatedSubqueries() {
+ return supportsCorrelatedSubqueries;
+ }
+
+ /**
+ * Sets whether this database supports correlated subqueries.
+ *
+ * @param supportsCorrelatedSubqueries <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsCorrelatedSubqueries( Boolean supportsCorrelatedSubqueries ) {
+ this.supportsCorrelatedSubqueries = supportsCorrelatedSubqueries;
+ }
+
+ /**
+ * Retrieves whether this database supports SQL <code>UNION</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsUnion() {
+ return supportsUnion;
+ }
+
+ /**
+ * Sets whether this database supports SQL <code>UNION</code>.
+ *
+ * @param supportsUnion <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsUnion( Boolean supportsUnion ) {
+ this.supportsUnion = supportsUnion;
+ }
+
+ /**
+ * Retrieves whether this database supports SQL <code>UNION ALL</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsUnionAll() {
+ return supportsUnionAll;
+ }
+
+ /**
+ * Sets whether this database supports SQL <code>UNION ALL</code>.
+ *
+ * @param supportsUnionAll <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsUnionAll( Boolean supportsUnionAll ) {
+ this.supportsUnionAll = supportsUnionAll;
+ }
+
+ /**
+ * Retrieves whether this database supports keeping cursors open across commits.
+ *
+ * @return <code>true</code> if cursors always remain open; <code>false</code> if they might not remain open
+ */
+ public Boolean isSupportsOpenCursorsAcrossCommit() {
+ return supportsOpenCursorsAcrossCommit;
+ }
+
+ /**
+ * Sets whether this database supports keeping cursors open across commits.
+ *
+ * @param supportsOpenCursorsAcrossCommit <code>true</code> if cursors always remain open; <code>false</code> if they might
+ * not remain open
+ */
+ public void setSupportsOpenCursorsAcrossCommit( Boolean supportsOpenCursorsAcrossCommit ) {
+ this.supportsOpenCursorsAcrossCommit = supportsOpenCursorsAcrossCommit;
+ }
+
+ /**
+ * Retrieves whether this database supports keeping cursors open across rollbacks.
+ *
+ * @return <code>true</code> if cursors always remain open; <code>false</code> if they might not remain open
+ */
+ public Boolean isSupportsOpenCursorsAcrossRollback() {
+ return supportsOpenCursorsAcrossRollback;
+ }
+
+ /**
+ * Sets whether this database supports keeping cursors open across rollbacks.
+ *
+ * @param supportsOpenCursorsAcrossRollback <code>true</code> if cursors always remain open; <code>false</code> if they might
+ * not remain open
+ */
+ public void setSupportsOpenCursorsAcrossRollback( Boolean supportsOpenCursorsAcrossRollback ) {
+ this.supportsOpenCursorsAcrossRollback = supportsOpenCursorsAcrossRollback;
+ }
+
+ /**
+ * Retrieves whether this database supports keeping statements open across commits.
+ *
+ * @return <code>true</code> if statements always remain open; <code>false</code> if they might not remain open
+ */
+ public Boolean isSupportsOpenStatementsAcrossCommit() {
+ return supportsOpenStatementsAcrossCommit;
+ }
+
+ /**
+ * sets whether this database supports keeping statements open across commits.
+ *
+ * @param supportsOpenStatementsAcrossCommit <code>true</code> if statements always remain open; <code>false</code> if they
+ * might not remain open
+ */
+ public void setSupportsOpenStatementsAcrossCommit( Boolean supportsOpenStatementsAcrossCommit ) {
+ this.supportsOpenStatementsAcrossCommit = supportsOpenStatementsAcrossCommit;
+ }
+
+ /**
+ * Retrieves whether this database supports keeping statements open across rollbacks.
+ *
+ * @return <code>true</code> if statements always remain open; <code>false</code> if they might not remain open
+ */
+ public Boolean isSupportsOpenStatementsAcrossRollback() {
+ return supportsOpenStatementsAcrossRollback;
+ }
+
+ /**
+ * Sets whether this database supports keeping statements open across rollbacks.
+ *
+ * @param supportsOpenStatementsAcrossRollback <code>true</code> if statements always remain open; <code>false</code> if they
+ * might not remain open
+ */
+ public void setSupportsOpenStatementsAcrossRollback( Boolean supportsOpenStatementsAcrossRollback ) {
+ this.supportsOpenStatementsAcrossRollback = supportsOpenStatementsAcrossRollback;
+ }
+
+ // ----------------------------------------------------------------------
+ // The following group of methods exposes various limitations based on the target
+ // database with the current driver. Unless otherwise specified, a result of zero
+ // means there is no limit, or the limit is not known.
+ // ----------------------------------------------------------------------
+
+ /**
+ * Retrieves the maximum number of hex characters this database allows in an inline binary literal.
+ *
+ * @return max the maximum length (in hex characters) for a binary literal; a result of zero means that there is no limit or
+ * the limit is not known
+ */
+ public Integer getMaxBinaryLiteralLength() {
+ return maxBinaryLiteralLength;
+ }
+
+ /**
+ * sets the maximum number of hex characters this database allows in an inline binary literal.
+ *
+ * @param maxBinaryLiteralLength max the maximum length (in hex characters) for a binary literal; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ public void setMaxBinaryLiteralLength( Integer maxBinaryLiteralLength ) {
+ this.maxBinaryLiteralLength = maxBinaryLiteralLength;
+ }
+
+ /**
+ * Retrieves the maximum number of characters this database allows for a character literal.
+ *
+ * @return the maximum number of characters allowed for a character literal; a result of zero means that there is no limit or
+ * the limit is not known
+ */
+ public Integer getMaxCharLiteralLength() {
+ return maxCharLiteralLength;
+ }
+
+ /**
+ * Sets the maximum number of characters this database allows for a character literal.
+ *
+ * @param maxCharLiteralLength the maximum number of characters allowed for a character literal; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ public void setMaxCharLiteralLength( Integer maxCharLiteralLength ) {
+ this.maxCharLiteralLength = maxCharLiteralLength;
+ }
+
+ /**
+ * Retrieves the maximum number of characters this database allows for a column name.
+ *
+ * @return the maximum number of characters allowed for a column name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxColumnNameLength() {
+ return maxColumnNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters this database allows for a column name.
+ *
+ * @param maxColumnNameLength the maximum number of characters allowed for a column name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ public void setMaxColumnNameLength( Integer maxColumnNameLength ) {
+ this.maxColumnNameLength = maxColumnNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a <code>GROUP BY</code> clause.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxColumnsInGroupBy() {
+ return maxColumnsInGroupBy;
+ }
+
+ /**
+ * Sets the maximum number of columns this database allows in a <code>GROUP BY</code> clause.
+ *
+ * @param maxColumnsInGroupBy the maximum number of columns allowed; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public void setMaxColumnsInGroupBy( Integer maxColumnsInGroupBy ) {
+ this.maxColumnsInGroupBy = maxColumnsInGroupBy;
+ }
+
+ /**
+ * Retrieves the maximum number of columns this database allows in an index.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxColumnsInIndex() {
+ return maxColumnsInIndex;
+ }
+
+ /**
+ * Sets the maximum number of columns this database allows in an index.
+ *
+ * @param maxColumnsInIndex the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ public void setMaxColumnsInIndex( Integer maxColumnsInIndex ) {
+ this.maxColumnsInIndex = maxColumnsInIndex;
+ }
+
+ /**
+ * Retrieves the maximum number of columns this database allows in an <code>ORDER BY</code> clause.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxColumnsInOrderBy() {
+ return maxColumnsInOrderBy;
+ }
+
+ /**
+ * Sets the maximum number of columns this database allows in an <code>ORDER BY</code> clause.
+ *
+ * @param maxColumnsInOrderBy the maximum number of columns allowed; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public void setMaxColumnsInOrderBy( Integer maxColumnsInOrderBy ) {
+ this.maxColumnsInOrderBy = maxColumnsInOrderBy;
+ }
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a <code>SELECT</code> list.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxColumnsInSelect() {
+ return maxColumnsInSelect;
+ }
+
+ /**
+ * Sets the maximum number of columns this database allows in a <code>SELECT</code> list.
+ *
+ * @param maxColumnsInSelect the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ public void setMaxColumnsInSelect( Integer maxColumnsInSelect ) {
+ this.maxColumnsInSelect = maxColumnsInSelect;
+ }
+
+ /**
+ * Retrieves the maximum number of columns this database allows in a table.
+ *
+ * @return the maximum number of columns allowed; a result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxColumnsInTable() {
+ return maxColumnsInTable;
+ }
+
+ /**
+ * Sets the maximum number of columns this database allows in a table.
+ *
+ * @param maxColumnsInTable the maximum number of columns allowed; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ public void setMaxColumnsInTable( Integer maxColumnsInTable ) {
+ this.maxColumnsInTable = maxColumnsInTable;
+ }
+
+ /**
+ * Retrieves the maximum number of concurrent connections to this database that are possible.
+ *
+ * @return the maximum number of active connections possible at one time; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxConnections() {
+ return maxConnections;
+ }
+
+ /**
+ * Sets the maximum number of concurrent connections to this database that are possible.
+ *
+ * @param maxConnections the maximum number of active connections possible at one time; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ public void setMaxConnections( Integer maxConnections ) {
+ this.maxConnections = maxConnections;
+ }
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a cursor name.
+ *
+ * @return the maximum number of characters allowed in a cursor name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxCursorNameLength() {
+ return maxCursorNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters that this database allows in a cursor name.
+ *
+ * @param maxCursorNameLength the maximum number of characters allowed in a cursor name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ public void setMaxCursorNameLength( Integer maxCursorNameLength ) {
+ this.maxCursorNameLength = maxCursorNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of bytes this database allows for an index, including all of the parts of the index.
+ *
+ * @return the maximum number of bytes allowed; this limit includes the composite of all the constituent parts of the index; a
+ * result of zero means that there is no limit or the limit is not known
+ */
+ public Integer getMaxIndexLength() {
+ return maxIndexLength;
+ }
+
+ /**
+ * Sets the maximum number of bytes this database allows for an index, including all of the parts of the index.
+ *
+ * @param maxIndexLength the maximum number of bytes allowed; this limit includes the composite of all the constituent parts
+ * of the index; a result of zero means that there is no limit or the limit is not known
+ */
+ public void setMaxIndexLength( Integer maxIndexLength ) {
+ this.maxIndexLength = maxIndexLength;
+ }
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a schema name.
+ *
+ * @return the maximum number of characters allowed in a schema name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxSchemaNameLength() {
+ return maxSchemaNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters that this database allows in a schema name.
+ *
+ * @param maxSchemaNameLength the maximum number of characters allowed in a schema name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ public void setMaxSchemaNameLength( Integer maxSchemaNameLength ) {
+ this.maxSchemaNameLength = maxSchemaNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a procedure name.
+ *
+ * @return the maximum number of characters allowed in a procedure name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxProcedureNameLength() {
+ return maxProcedureNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters that this database allows in a procedure name.
+ *
+ * @param maxProcedureNameLength the maximum number of characters allowed in a procedure name; a result of zero means that
+ * there is no limit or the limit is not known
+ */
+ public void setMaxProcedureNameLength( Integer maxProcedureNameLength ) {
+ this.maxProcedureNameLength = maxProcedureNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of characters that this database allows in a catalog name.
+ *
+ * @return the maximum number of characters allowed in a catalog name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxCatalogNameLength() {
+ return maxCatalogNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters that this database allows in a catalog name.
+ *
+ * @param maxCatalogNameLength the maximum number of characters allowed in a catalog name; a result of zero means that there
+ * is no limit or the limit is not known
+ */
+ public void setMaxCatalogNameLength( Integer maxCatalogNameLength ) {
+ this.maxCatalogNameLength = maxCatalogNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of bytes this database allows in a single row.
+ *
+ * @return the maximum number of bytes allowed for a row; a result of zero means that there is no limit or the limit is not
+ * known
+ */
+ public Integer getMaxRowSize() {
+ return maxRowSize;
+ }
+
+ /**
+ * Sets the maximum number of bytes this database allows in a single row.
+ *
+ * @param maxRowSize the maximum number of bytes allowed for a row; a result of zero means that there is no limit or the limit
+ * is not known
+ */
+ public void setMaxRowSize( Integer maxRowSize ) {
+ this.maxRowSize = maxRowSize;
+ }
+
+ /**
+ * Retrieves whether the return value for the method <code>getMaxRowSize</code> includes the SQL data types
+ * <code>LONGVARCHAR</code> and <code>LONGVARBINARY</code>.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isMaxRowSizeIncludeBlobs() {
+ return maxRowSizeIncludeBlobs;
+ }
+
+ /**
+ * Sets whether the return value for the method <code>getMaxRowSize</code> includes the SQL data types
+ * <code>LONGVARCHAR</code> and <code>LONGVARBINARY</code>.
+ *
+ * @param maxRowSizeIncludeBlobs <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setMaxRowSizeIncludeBlobs( Boolean maxRowSizeIncludeBlobs ) {
+ this.maxRowSizeIncludeBlobs = maxRowSizeIncludeBlobs;
+ }
+
+ /**
+ * Retrieves the maximum number of characters this database allows in an SQL statement.
+ *
+ * @return the maximum number of characters allowed for an SQL statement; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxStatementLength() {
+ return maxStatementLength;
+ }
+
+ /**
+ * Sets the maximum number of characters this database allows in an SQL statement.
+ *
+ * @param maxStatementLength the maximum number of characters allowed for an SQL statement; a result of zero means that there
+ * is no limit or the limit is not known
+ */
+ public void setMaxStatementLength( Integer maxStatementLength ) {
+ this.maxStatementLength = maxStatementLength;
+ }
+
+ /**
+ * Retrieves the maximum number of active statements to this database that can be open at the same time.
+ *
+ * @return the maximum number of statements that can be open at one time; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxStatements() {
+ return maxStatements;
+ }
+
+ /**
+ * Sets the maximum number of active statements to this database that can be open at the same time.
+ *
+ * @param maxStatements the maximum number of statements that can be open at one time; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ public void setMaxStatements( Integer maxStatements ) {
+ this.maxStatements = maxStatements;
+ }
+
+ /**
+ * Retrieves the maximum number of characters this database allows in a table name.
+ *
+ * @return the maximum number of characters allowed for a table name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxTableNameLength() {
+ return maxTableNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters this database allows in a table name.
+ *
+ * @param maxTableNameLength the maximum number of characters allowed for a table name; a result of zero means that there is
+ * no limit or the limit is not known
+ */
+ public void setMaxTableNameLength( Integer maxTableNameLength ) {
+ this.maxTableNameLength = maxTableNameLength;
+ }
+
+ /**
+ * Retrieves the maximum number of tables this database allows in a <code>SELECT</code> statement.
+ *
+ * @return the maximum number of tables allowed in a <code>SELECT</code> statement; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ public Integer getMaxTablesInSelect() {
+ return maxTablesInSelect;
+ }
+
+ /**
+ * Sets the maximum number of tables this database allows in a <code>SELECT</code> statement.
+ *
+ * @param maxTablesInSelect the maximum number of tables allowed in a <code>SELECT</code> statement; a result of zero means
+ * that there is no limit or the limit is not known
+ */
+ public void setMaxTablesInSelect( Integer maxTablesInSelect ) {
+ this.maxTablesInSelect = maxTablesInSelect;
+ }
+
+ /**
+ * Retrieves the maximum number of characters this database allows in a user name.
+ *
+ * @return the maximum number of characters allowed for a user name; a result of zero means that there is no limit or the
+ * limit is not known
+ */
+ public Integer getMaxUserNameLength() {
+ return maxUserNameLength;
+ }
+
+ /**
+ * Sets the maximum number of characters this database allows in a user name.
+ *
+ * @param maxUserNameLength the maximum number of characters allowed for a user name; a result of zero means that there is no
+ * limit or the limit is not known
+ */
+ public void setMaxUserNameLength( Integer maxUserNameLength ) {
+ this.maxUserNameLength = maxUserNameLength;
+ }
+
+ /**
+ * Retrieves this database's default transaction isolation level. The possible values are defined in
+ * <code>java.sql.Connection</code>.
+ *
+ * @return the default isolation level
+ * @see java.sql.Connection
+ */
+ public Integer getDefaultTransactionIsolation() {
+ return defaultTransactionIsolation;
+ }
+
+ /**
+ * Sets this database's default transaction isolation level. The possible values are defined in
+ * <code>java.sql.Connection</code>.
+ *
+ * @param defaultTransactionIsolation the default isolation level
+ * @see java.sql.Connection
+ */
+ public void setDefaultTransactionIsolation( Integer defaultTransactionIsolation ) {
+ this.defaultTransactionIsolation = defaultTransactionIsolation;
+ }
+
+ /**
+ * Retrieves whether this database supports transactions. If not, invoking the method <code>commit</code> is a noop, and the
+ * isolation level is <code>TRANSACTION_NONE</code>.
+ *
+ * @return <code>true</code> if transactions are supported; <code>false</code> otherwise
+ */
+ public Boolean isSupportsTransactions() {
+ return supportsTransactions;
+ }
+
+ /**
+ * Sets whether this database supports transactions. If not, invoking the method <code>commit</code> is a noop, and the
+ * isolation level is <code>TRANSACTION_NONE</code>.
+ *
+ * @param supportsTransactions <code>true</code> if transactions are supported; <code>false</code> otherwise
+ */
+ public void setSupportsTransactions( Boolean supportsTransactions ) {
+ this.supportsTransactions = supportsTransactions;
+ }
+
+ /**
+ * Retrieves list of database supported transaction isolation levels.
+ *
+ * @return list of database supported transaction isolation levels.
+ * @see java.sql.Connection
+ */
+ public Set<TransactionIsolationLevelType> getSupportedTransactionIsolationLevels() {
+ return supportedTransactionIsolationLevels;
+ }
+
+ /**
+ * Adds TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ */
+ public void addSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType ) {
+ supportedTransactionIsolationLevels.add(transactionIsolationLevelType);
+ }
+
+ /**
+ * Deletes TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ */
+ public void deleteSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType ) {
+ supportedTransactionIsolationLevels.remove(transactionIsolationLevelType);
+ }
+
+ /**
+ * Is supported TransactionIsolationLevelType
+ *
+ * @param transactionIsolationLevelType the Transaction Isolation Level Type
+ * @return true if supported
+ */
+ public Boolean isSupportedTransactionIsolationLevelType( TransactionIsolationLevelType transactionIsolationLevelType ) {
+ for (TransactionIsolationLevelType t : supportedTransactionIsolationLevels) {
+ if (t.equals(transactionIsolationLevelType)) {
+ return Boolean.TRUE;
+ }
+ }
+ // return false
+ return Boolean.FALSE;
+ }
+
+ /**
+ * Retrieves whether this database supports both data definition and data manipulation statements within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsDataDefinitionAndDataManipulationTransactions() {
+ return supportsDataDefinitionAndDataManipulationTransactions;
+ }
+
+ /**
+ * Sets whether this database supports both data definition and data manipulation statements within a transaction.
+ *
+ * @param supportsDataDefinitionAndDataManipulationTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsDataDefinitionAndDataManipulationTransactions( Boolean supportsDataDefinitionAndDataManipulationTransactions ) {
+ this.supportsDataDefinitionAndDataManipulationTransactions = supportsDataDefinitionAndDataManipulationTransactions;
+ }
+
+ /**
+ * Retrieves whether this database supports only data manipulation statements within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isSupportsDataManipulationTransactionsOnly() {
+ return supportsDataManipulationTransactionsOnly;
+ }
+
+ /**
+ * Sets whether this database supports only data manipulation statements within a transaction.
+ *
+ * @param supportsDataManipulationTransactionsOnly <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setSupportsDataManipulationTransactionsOnly( Boolean supportsDataManipulationTransactionsOnly ) {
+ this.supportsDataManipulationTransactionsOnly = supportsDataManipulationTransactionsOnly;
+ }
+
+ /**
+ * Retrieves whether a data definition statement within a transaction forces the transaction to commit.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isDataDefinitionCausesTransactionCommit() {
+ return dataDefinitionCausesTransactionCommit;
+ }
+
+ /**
+ * Sets whether a data definition statement within a transaction forces the transaction to commit.
+ *
+ * @param dataDefinitionCausesTransactionCommit <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setDataDefinitionCausesTransactionCommit( Boolean dataDefinitionCausesTransactionCommit ) {
+ this.dataDefinitionCausesTransactionCommit = dataDefinitionCausesTransactionCommit;
+ }
+
+ /**
+ * Retrieves whether this database ignores a data definition statement within a transaction.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ */
+ public Boolean isDataDefinitionIgnoredInTransactions() {
+ return dataDefinitionIgnoredInTransactions;
+ }
+
+ /**
+ * Sets whether this database ignores a data definition statement within a transaction.
+ *
+ * @param dataDefinitionIgnoredInTransactions <code>true</code> if so; <code>false</code> otherwise
+ */
+ public void setDataDefinitionIgnoredInTransactions( Boolean dataDefinitionIgnoredInTransactions ) {
+ this.dataDefinitionIgnoredInTransactions = dataDefinitionIgnoredInTransactions;
+ }
+
+ /**
+ * Retrieves a description of the stored procedures available in the given catalog.
+ *
+ * @return a set of stored procedures available
+ */
+ public Set<StoredProcedure> getStoredProcedures() {
+ return storedProcedures;
+ }
+
+ /**
+ * Adds Stored Procedure
+ *
+ * @param storedProcedure the Stored Procedure
+ */
+ public void addStoredProcedure( StoredProcedure storedProcedure ) {
+ storedProcedures.add(storedProcedure);
+ }
+
+ /**
+ * Deletes Stored Procedure
+ *
+ * @param storedProcedure the Stored Procedure
+ */
+ public void deleteStoredProcedure( StoredProcedure storedProcedure ) {
+ storedProcedures.remove(storedProcedure);
+ }
+
+ /**
+ * Finds stored procedute by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param procedureName a procedure name; must match the procedure name as it is stored in the database
+ * @return stored procedure or null if not found
+ */
+ public StoredProcedure findStoredProcedureByName( String catalog,
+ String schema,
+ String procedureName ) {
+ for (StoredProcedure sp : storedProcedures) {
+ // if name equals then trying to match catalog and schema
+ if (sp.getName().equals(procedureName)) {
+ boolean catalogNameEquals = (sp.getCatalog() != null) ? sp.getCatalog().getName().equals(catalog) : catalog == null;
+ boolean schemaNameEquals = (sp.getSchema() != null) ? sp.getSchema().getName().equals(schema) : schema == null;
+ if (catalogNameEquals && schemaNameEquals) {
+ return sp;
+ }
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves a description of the tables available in the given catalog.
+ *
+ * @return a set of tables available
+ */
+ public Set<Table> getTables() {
+ return tables;
+ }
+
+ /**
+ * Adds Table
+ *
+ * @param table the table to add
+ */
+ public void addTable( Table table ) {
+ tables.add(table);
+ }
+
+ /**
+ * Deletes Table
+ *
+ * @param table the table to delete
+ */
+ public void deleteTable( Table table ) {
+ tables.remove(table);
+ }
+
+ /**
+ * Finds table by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param tableName a table name; must match the table name as it is stored in the database
+ * @return table or null if not found
+ */
+ public Table findTableByName( String catalog,
+ String schema,
+ String tableName ) {
+ for (Table t : tables) {
+ // if name equals then trying to match catalog and schema
+ if (t.getName().equals(tableName)) {
+ boolean catalogNameEquals = (t.getCatalog() != null) ? t.getCatalog().getName().equals(catalog) : catalog == null;
+ boolean schemaNameEquals = (t.getSchema() != null) ? t.getSchema().getName().equals(schema) : schema == null;
+ if (catalogNameEquals && schemaNameEquals) {
+ return t;
+ }
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves the schemas available in this database. The results are ordered by schema name.
+ *
+ * @return schemas available in this database.
+ */
+ public Set<Schema> getSchemas() {
+ return schemas;
+ }
+
+ /**
+ * Adds Schema
+ *
+ * @param schema the Schema
+ */
+ public void addSchema( Schema schema ) {
+ schemas.add(schema);
+ }
+
+ /**
+ * Deletes Schema
+ *
+ * @param schema the Schema
+ */
+ public void deleteSchema( Schema schema ) {
+ schemas.remove(schema);
+ }
+
+ /**
+ * Finds schema by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schemaName a schema name; must match the schema name as it is stored in the database;
+ * @return schema or null if not found
+ */
+ public Schema findSchemaByName( String catalog,
+ String schemaName ) {
+ for (Schema s : schemas) {
+ // if name equals then trying to match catalog and schema
+ if (s.getName().equals(schemaName)) {
+ boolean catalogNameEquals = (s.getCatalog() != null) ? s.getCatalog().getName().equals(catalog) : catalog == null;
+ if (catalogNameEquals) {
+ return s;
+ }
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves the catalogs available in this database
+ *
+ * @return catalogs available in this database
+ */
+ public Set<Catalog> getCatalogs() {
+ return catalogs;
+ }
+
+ /**
+ * Adds Catalog
+ *
+ * @param catalog the catalog to add
+ */
+ public void addCatalog( Catalog catalog ) {
+ catalogs.add(catalog);
+ }
+
+ /**
+ * Deletes Catalog
+ *
+ * @param catalog the catalog to delete
+ */
+ public void deleteCatalog( Catalog catalog ) {
+ catalogs.remove(catalog);
+ }
+
+ /**
+ * Finds catalog by its name.
+ *
+ * @param catalogName a catalog name; must match the catalog name as it is stored in the database;
+ * @return catalog or null if not found
+ */
+ public Catalog findCatalogByName( String catalogName ) {
+ for (Catalog c : catalogs) {
+ // if name equals then return
+ if (c.getName().equals(catalogName)) {
+ return c;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves the table types available in this database. The results are ordered by table type.
+ * <P>
+ * The table type is:
+ * <OL>
+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ * </OL>
+ *
+ * @return table types available in this database
+ */
+ public Set<TableType> getTableTypes() {
+ return tableTypes;
+ }
+
+ /**
+ * Adds TableType
+ *
+ * @param tableType the table type to add
+ */
+ public void addTableType( TableType tableType ) {
+ tableTypes.add(tableType);
+ }
+
+ /**
+ * Deletes TableType
+ *
+ * @param tableType the table type to delete
+ */
+ public void deleteTableType( TableType tableType ) {
+ tableTypes.remove(tableType);
+ }
+
+ /**
+ * Finds table type by its name.
+ *
+ * @param typeName a table type name; must match the type name as it is stored in the database;
+ * @return table type or null if not found
+ */
+ public TableType findTableTypeByTypeName( String typeName ) {
+ for (TableType tt : tableTypes) {
+ // if name equals then return
+ if (tt.getName().equals(typeName)) {
+ return tt;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves a description of all the standard SQL types supported by this database
+ *
+ * @return all the standard SQL types supported by this database
+ */
+ public Set<SqlTypeInfo> getSqlTypeInfos() {
+ return sqlTypeInfos;
+ }
+
+ /**
+ * Adds SqlTypeInfo
+ *
+ * @param sqlTypeInfo the SQL type to add
+ */
+ public void addSqlTypeInfo( SqlTypeInfo sqlTypeInfo ) {
+ sqlTypeInfos.add(sqlTypeInfo);
+ }
+
+ /**
+ * Deletes SqlTypeInfo
+ *
+ * @param sqlTypeInfo the SQL type to delete
+ */
+ public void deleteSqlTypeInfo( SqlTypeInfo sqlTypeInfo ) {
+ sqlTypeInfos.remove(sqlTypeInfo);
+ }
+
+ /**
+ * Finds SQL type by its name.
+ *
+ * @param typeName a table type name; must match the type name as it is stored in the database;
+ * @return table type or null if not found
+ */
+ public SqlTypeInfo findSqlTypeInfoByTypeName( String typeName ) {
+ for (SqlTypeInfo sti : sqlTypeInfos) {
+ // if name equals then return
+ if (sti.getName().equals(typeName)) {
+ return sti;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ // ===============================================================
+ // --------------------------JDBC 2.0-----------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves database supported result set types.
+ *
+ * @return database supported result set types.
+ * @see java.sql.Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Set<ResultSetType> getSupportedResultSetTypes() {
+ return supportedResultSetTypes;
+ }
+
+ /**
+ * Adds supported ResultSetType
+ *
+ * @param resultSetType the ResultSetType
+ */
+ public void addSupportedResultSetType( ResultSetType resultSetType ) {
+ supportedResultSetTypes.add(resultSetType);
+ }
+
+ /**
+ * Deletes supported ResultSetType
+ *
+ * @param resultSetType the ResultSetType
+ */
+ public void deleteSupportedResultSetType( ResultSetType resultSetType ) {
+ supportedResultSetTypes.remove(resultSetType);
+ }
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see java.sql.Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Set<ResultSetConcurrencyType> getSupportedForwardOnlyResultSetConcurrencies() {
+ return supportedForwardOnlyResultSetConcurrencies;
+ }
+
+ /**
+ * Adds ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void addSupportedForwardOnlyResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedForwardOnlyResultSetConcurrencies.add(resultSetConcurrencyType);
+ }
+
+ /**
+ * Deletes ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void deleteSupportedForwardOnlyResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedForwardOnlyResultSetConcurrencies.remove(resultSetConcurrencyType);
+ }
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see java.sql.Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Set<ResultSetConcurrencyType> getSupportedScrollInsensitiveResultSetConcurrencies() {
+ return supportedScrollInsensitiveResultSetConcurrencies;
+ }
+
+ /**
+ * Adds ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void addSupportedScrollInsensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedScrollInsensitiveResultSetConcurrencies.add(resultSetConcurrencyType);
+ }
+
+ /**
+ * Delete ResultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void deleteSupportedScrollInsensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedScrollInsensitiveResultSetConcurrencies.remove(resultSetConcurrencyType);
+ }
+
+ /**
+ * Retrieves database supported concurrencies for the given result set type.
+ *
+ * @return database supported concurrencies for the given result set type.
+ * @see java.sql.Connection
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Set<ResultSetConcurrencyType> getSupportedScrollSensitiveResultSetConcurrencies() {
+ return supportedScrollSensitiveResultSetConcurrencies;
+ }
+
+ /**
+ * Adds resultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void addSupportedScrollSensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedScrollSensitiveResultSetConcurrencies.add(resultSetConcurrencyType);
+ }
+
+ /**
+ * deletes resultSetConcurrencyType
+ *
+ * @param resultSetConcurrencyType the ResultSetConcurrencyType
+ */
+ public void deleteSupportedScrollSensitiveResultSetConcurrency( ResultSetConcurrencyType resultSetConcurrencyType ) {
+ supportedScrollSensitiveResultSetConcurrencies.remove(resultSetConcurrencyType);
+ }
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOwnUpdatesAreVisible() {
+ return forwardOnlyResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param forwardOnlyResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOwnUpdatesAreVisible( Boolean forwardOnlyResultSetOwnUpdatesAreVisible ) {
+ this.forwardOnlyResultSetOwnUpdatesAreVisible = forwardOnlyResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOwnUpdatesAreVisible() {
+ return scrollInsensitiveResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOwnUpdatesAreVisible( Boolean scrollInsensitiveResultSetOwnUpdatesAreVisible ) {
+ this.scrollInsensitiveResultSetOwnUpdatesAreVisible = scrollInsensitiveResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @return <code>true</code> if updates are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOwnUpdatesAreVisible() {
+ return scrollSensitiveResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether for the given type of <code>ResultSet</code> object, the result set's own updates are visible.
+ *
+ * @param scrollSensitiveResultSetOwnUpdatesAreVisible <code>true</code> if updates are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOwnUpdatesAreVisible( Boolean scrollSensitiveResultSetOwnUpdatesAreVisible ) {
+ this.scrollSensitiveResultSetOwnUpdatesAreVisible = scrollSensitiveResultSetOwnUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOwnDeletesAreVisible() {
+ return forwardOnlyResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param forwardOnlyResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOwnDeletesAreVisible( Boolean forwardOnlyResultSetOwnDeletesAreVisible ) {
+ this.forwardOnlyResultSetOwnDeletesAreVisible = forwardOnlyResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOwnDeletesAreVisible() {
+ return scrollInsensitiveResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOwnDeletesAreVisible( Boolean scrollInsensitiveResultSetOwnDeletesAreVisible ) {
+ this.scrollInsensitiveResultSetOwnDeletesAreVisible = scrollInsensitiveResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own deletes are visible.
+ *
+ * @return <code>true</code> if deletes are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOwnDeletesAreVisible() {
+ return scrollSensitiveResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own deletes are visible.
+ *
+ * @param scrollSensitiveResultSetOwnDeletesAreVisible <code>true</code> if deletes are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOwnDeletesAreVisible( Boolean scrollSensitiveResultSetOwnDeletesAreVisible ) {
+ this.scrollSensitiveResultSetOwnDeletesAreVisible = scrollSensitiveResultSetOwnDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOwnInsertsAreVisible() {
+ return forwardOnlyResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param forwardOnlyResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOwnInsertsAreVisible( Boolean forwardOnlyResultSetOwnInsertsAreVisible ) {
+ this.forwardOnlyResultSetOwnInsertsAreVisible = forwardOnlyResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOwnInsertsAreVisible() {
+ return scrollInsensitiveResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param scrollInsensitiveResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOwnInsertsAreVisible( Boolean scrollInsensitiveResultSetOwnInsertsAreVisible ) {
+ this.scrollInsensitiveResultSetOwnInsertsAreVisible = scrollInsensitiveResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether a result set's own inserts are visible.
+ *
+ * @return <code>true</code> if inserts are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOwnInsertsAreVisible() {
+ return scrollSensitiveResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether a result set's own inserts are visible.
+ *
+ * @param scrollSensitiveResultSetOwnInsertsAreVisible <code>true</code> if inserts are visible for the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOwnInsertsAreVisible( Boolean scrollSensitiveResultSetOwnInsertsAreVisible ) {
+ this.scrollSensitiveResultSetOwnInsertsAreVisible = scrollSensitiveResultSetOwnInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOthersUpdatesAreVisible() {
+ return forwardOnlyResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOthersUpdatesAreVisible( Boolean forwardOnlyResultSetOthersUpdatesAreVisible ) {
+ this.forwardOnlyResultSetOthersUpdatesAreVisible = forwardOnlyResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOthersUpdatesAreVisible() {
+ return scrollInsensitiveResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOthersUpdatesAreVisible( Boolean scrollInsensitiveResultSetOthersUpdatesAreVisible ) {
+ this.scrollInsensitiveResultSetOthersUpdatesAreVisible = scrollInsensitiveResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether updates made by others are visible.
+ *
+ * @return <code>true</code> if updates made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOthersUpdatesAreVisible() {
+ return scrollSensitiveResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Sets whether updates made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersUpdatesAreVisible <code>true</code> if updates made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOthersUpdatesAreVisible( Boolean scrollSensitiveResultSetOthersUpdatesAreVisible ) {
+ this.scrollSensitiveResultSetOthersUpdatesAreVisible = scrollSensitiveResultSetOthersUpdatesAreVisible;
+ }
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOthersDeletesAreVisible() {
+ return forwardOnlyResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOthersDeletesAreVisible( Boolean forwardOnlyResultSetOthersDeletesAreVisible ) {
+ this.forwardOnlyResultSetOthersDeletesAreVisible = forwardOnlyResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOthersDeletesAreVisible() {
+ return scrollInsensitiveResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOthersDeletesAreVisible( Boolean scrollInsensitiveResultSetOthersDeletesAreVisible ) {
+ this.scrollInsensitiveResultSetOthersDeletesAreVisible = scrollInsensitiveResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether deletes made by others are visible.
+ *
+ * @return <code>true</code> if deletes made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOthersDeletesAreVisible() {
+ return scrollSensitiveResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Sets whether deletes made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersDeletesAreVisible <code>true</code> if deletes made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOthersDeletesAreVisible( Boolean scrollSensitiveResultSetOthersDeletesAreVisible ) {
+ this.scrollSensitiveResultSetOthersDeletesAreVisible = scrollSensitiveResultSetOthersDeletesAreVisible;
+ }
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetOthersInsertsAreVisible() {
+ return forwardOnlyResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param forwardOnlyResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the given
+ * result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetOthersInsertsAreVisible( Boolean forwardOnlyResultSetOthersInsertsAreVisible ) {
+ this.forwardOnlyResultSetOthersInsertsAreVisible = forwardOnlyResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetOthersInsertsAreVisible() {
+ return scrollInsensitiveResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param scrollInsensitiveResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetOthersInsertsAreVisible( Boolean scrollInsensitiveResultSetOthersInsertsAreVisible ) {
+ this.scrollInsensitiveResultSetOthersInsertsAreVisible = scrollInsensitiveResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether inserts made by others are visible.
+ *
+ * @return <code>true</code> if inserts made by others are visible for the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetOthersInsertsAreVisible() {
+ return scrollSensitiveResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Sets whether inserts made by others are visible.
+ *
+ * @param scrollSensitiveResultSetOthersInsertsAreVisible <code>true</code> if inserts made by others are visible for the
+ * given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetOthersInsertsAreVisible( Boolean scrollSensitiveResultSetOthersInsertsAreVisible ) {
+ this.scrollSensitiveResultSetOthersInsertsAreVisible = scrollSensitiveResultSetOthersInsertsAreVisible;
+ }
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetUpdatesAreDetected() {
+ return forwardOnlyResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param forwardOnlyResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetUpdatesAreDetected( Boolean forwardOnlyResultSetUpdatesAreDetected ) {
+ this.forwardOnlyResultSetUpdatesAreDetected = forwardOnlyResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetUpdatesAreDetected() {
+ return scrollInsensitiveResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param scrollInsensitiveResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetUpdatesAreDetected( Boolean scrollInsensitiveResultSetUpdatesAreDetected ) {
+ this.scrollInsensitiveResultSetUpdatesAreDetected = scrollInsensitiveResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @return <code>true</code> if changes are detected by the result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetUpdatesAreDetected() {
+ return scrollSensitiveResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row update can be detected by calling the method <code>ResultSet.rowUpdated</code>.
+ *
+ * @param scrollSensitiveResultSetUpdatesAreDetected <code>true</code> if changes are detected by the result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetUpdatesAreDetected( Boolean scrollSensitiveResultSetUpdatesAreDetected ) {
+ this.scrollSensitiveResultSetUpdatesAreDetected = scrollSensitiveResultSetUpdatesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultSetDeletesAreDetected() {
+ return forwardOnlyResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param forwardOnlyResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultSetDeletesAreDetected( Boolean forwardOnlyResultSetDeletesAreDetected ) {
+ this.forwardOnlyResultSetDeletesAreDetected = forwardOnlyResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultSetDeletesAreDetected() {
+ return scrollInsensitiveResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param scrollInsensitiveResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultSetDeletesAreDetected( Boolean scrollInsensitiveResultSetDeletesAreDetected ) {
+ this.scrollInsensitiveResultSetDeletesAreDetected = scrollInsensitiveResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If
+ * the method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the
+ * result set.
+ *
+ * @return <code>true</code> if deletes are detected by the given result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultSetDeletesAreDetected() {
+ return scrollSensitiveResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row delete can be detected by calling the method <code>ResultSet.rowDeleted</code>. If the
+ * method <code>deletesAreDetected</code> returns <code>false</code>, it means that deleted rows are removed from the result
+ * set.
+ *
+ * @param scrollSensitiveResultSetDeletesAreDetected <code>true</code> if deletes are detected by the given result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultSetDeletesAreDetected( Boolean scrollSensitiveResultSetDeletesAreDetected ) {
+ this.scrollSensitiveResultSetDeletesAreDetected = scrollSensitiveResultSetDeletesAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isForwardOnlyResultInsertsAreDetected() {
+ return forwardOnlyResultInsertsAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param forwardOnlyResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setForwardOnlyResultInsertsAreDetected( Boolean forwardOnlyResultInsertsAreDetected ) {
+ this.forwardOnlyResultInsertsAreDetected = forwardOnlyResultInsertsAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollInsensitiveResultInsertsAreDetected() {
+ return scrollInsensitiveResultInsertsAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param scrollInsensitiveResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set
+ * type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollInsensitiveResultInsertsAreDetected( Boolean scrollInsensitiveResultInsertsAreDetected ) {
+ this.scrollInsensitiveResultInsertsAreDetected = scrollInsensitiveResultInsertsAreDetected;
+ }
+
+ /**
+ * Retrieves whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @return <code>true</code> if changes are detected by the specified result set type; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isScrollSensitiveResultInsertsAreDetected() {
+ return scrollSensitiveResultInsertsAreDetected;
+ }
+
+ /**
+ * Sets whether or not a visible row insert can be detected by calling the method <code>ResultSet.rowInserted</code>.
+ *
+ * @param scrollSensitiveResultInsertsAreDetected <code>true</code> if changes are detected by the specified result set type;
+ * <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setScrollSensitiveResultInsertsAreDetected( Boolean scrollSensitiveResultInsertsAreDetected ) {
+ this.scrollSensitiveResultInsertsAreDetected = scrollSensitiveResultInsertsAreDetected;
+ }
+
+ /**
+ * Retrieves whether this database supports batch updates.
+ *
+ * @return <code>true</code> if this database supports batch upcates; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public Boolean isSupportsBatchUpdates() {
+ return supportsBatchUpdates;
+ }
+
+ /**
+ * Sets whether this database supports batch updates.
+ *
+ * @param supportsBatchUpdates <code>true</code> if this database supports batch upcates; <code>false</code> otherwise
+ * @since 1.2 (JDBC 2.0)
+ */
+ public void setSupportsBatchUpdates( Boolean supportsBatchUpdates ) {
+ this.supportsBatchUpdates = supportsBatchUpdates;
+ }
+
+ /**
+ * Retrieves a description of the UDT available in the given catalog.
+ *
+ * @return a set of UDT available
+ */
+ public Set<UserDefinedType> getUserDefinedTypes() {
+ return userDefinedTypes;
+ }
+
+ /**
+ * Adds UDT
+ *
+ * @param udt the UDT to add
+ */
+ public void addUserDefinedType( UserDefinedType udt ) {
+ userDefinedTypes.add(udt);
+ }
+
+ /**
+ * Deletes UDT
+ *
+ * @param udt the UDT to delete
+ */
+ public void deleteUserDefinedType( UserDefinedType udt ) {
+ userDefinedTypes.remove(udt);
+ }
+
+ /**
+ * Finds UDT by its name.
+ *
+ * @param catalog a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a
+ * catalog; <code>null</code> means that the catalog name should not be used to narrow the search
+ * @param schema a schema name; must match the schema name as it is stored in the database; "" retrieves those without a
+ * schema; <code>null</code> means that the schema name should not be used to narrow the search
+ * @param tableName a table name; must match the table name as it is stored in the database
+ * @return table or null if not found
+ */
+ public UserDefinedType findUserDefinedTypeByName( String catalog,
+ String schema,
+ String tableName ) {
+ for (UserDefinedType udt : userDefinedTypes) {
+ if (udt.getName().equals(tableName)) {
+ boolean catalogNameEquals = (udt.getCatalog() != null) ? udt.getCatalog().getName().equals(catalog) : catalog == null;
+ boolean schemaNameEquals = (udt.getSchema() != null) ? udt.getSchema().getName().equals(schema) : schema == null;
+ if (catalogNameEquals && schemaNameEquals) {
+ return udt;
+ }
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves whether this database supports savepoints.
+ *
+ * @return <code>true</code> if savepoints are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsSavepoints() {
+ return supportsSavepoints;
+ }
+
+ /**
+ * Sets whether this database supports savepoints.
+ *
+ * @param supportsSavepoints <code>true</code> if savepoints are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsSavepoints( Boolean supportsSavepoints ) {
+ this.supportsSavepoints = supportsSavepoints;
+ }
+
+ /**
+ * Retrieves whether this database supports named parameters to callable statements.
+ *
+ * @return <code>true</code> if named parameters are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsNamedParameters() {
+ return supportsNamedParameters;
+ }
+
+ /**
+ * Sets whether this database supports named parameters to callable statements.
+ *
+ * @param supportsNamedParameters <code>true</code> if named parameters are supported; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsNamedParameters( Boolean supportsNamedParameters ) {
+ this.supportsNamedParameters = supportsNamedParameters;
+ }
+
+ /**
+ * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects returned from a
+ * <code>CallableStatement</code> object simultaneously.
+ *
+ * @return <code>true</code> if a <code>CallableStatement</code> object can return multiple <code>ResultSet</code> objects
+ * simultaneously; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsMultipleOpenResults() {
+ return supportsMultipleOpenResults;
+ }
+
+ /**
+ * Sets whether it is possible to have multiple <code>ResultSet</code> objects returned from a <code>CallableStatement</code>
+ * object simultaneously.
+ *
+ * @param supportsMultipleOpenResults <code>true</code> if a <code>CallableStatement</code> object can return multiple
+ * <code>ResultSet</code> objects simultaneously; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsMultipleOpenResults( Boolean supportsMultipleOpenResults ) {
+ this.supportsMultipleOpenResults = supportsMultipleOpenResults;
+ }
+
+ /**
+ * Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
+ *
+ * @return <code>true</code> if auto-generated keys can be retrieved after a statement has executed; <code>false</code>
+ * otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsGetGeneratedKeys() {
+ return supportsGetGeneratedKeys;
+ }
+
+ /**
+ * Sets whether auto-generated keys can be retrieved after a statement has been executed.
+ *
+ * @param supportsGetGeneratedKeys <code>true</code> if auto-generated keys can be retrieved after a statement has executed;
+ * <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsGetGeneratedKeys( Boolean supportsGetGeneratedKeys ) {
+ this.supportsGetGeneratedKeys = supportsGetGeneratedKeys;
+ }
+
+ /**
+ * Retrieves whether this database supports the given result set holdability.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @see java.sql.Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsResultSetHoldCurrorsOverCommitHoldability() {
+ return supportsResultSetHoldCurrorsOverCommitHoldability;
+ }
+
+ /**
+ * Sets whether this database supports the given result set holdability.
+ *
+ * @param supportsResultSetHoldCurrorsOverCommitHoldability <code>true</code> if so; <code>false</code> otherwise
+ * @see java.sql.Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsResultSetHoldCurrorsOverCommitHoldability( Boolean supportsResultSetHoldCurrorsOverCommitHoldability ) {
+ this.supportsResultSetHoldCurrorsOverCommitHoldability = supportsResultSetHoldCurrorsOverCommitHoldability;
+ }
+
+ /**
+ * Retrieves whether this database supports the given result set holdability.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @see java.sql.Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsResultSetCloseCurrorsAtCommitHoldability() {
+ return supportsResultSetCloseCurrorsAtCommitHoldability;
+ }
+
+ /**
+ * Sets whether this database supports the given result set holdability.
+ *
+ * @param supportsResultSetCloseCurrorsAtCommitHoldability <code>true</code> if so; <code>false</code> otherwise
+ * @see java.sql.Connection
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsResultSetCloseCurrorsAtCommitHoldability( Boolean supportsResultSetCloseCurrorsAtCommitHoldability ) {
+ this.supportsResultSetCloseCurrorsAtCommitHoldability = supportsResultSetCloseCurrorsAtCommitHoldability;
+ }
+
+ /**
+ * Retrieves the default holdability of this <code>ResultSet</code> object.
+ *
+ * @return the default holdability; either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
+ *
+ * @since 1.4
+ */
+ public ResultSetHoldabilityType getResultSetHoldabilityType() {
+ return resultSetHoldabilityType;
+ }
+
+ /**
+ * Sets the default holdability of this <code>ResultSet</code> object.
+ *
+ * @param resultSetHoldabilityType the ResultSetHoldabilityType
+ * the default holdability; either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
+ * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
+ *
+ * @since 1.4
+ */
+ public void setResultSetHoldabilityType( ResultSetHoldabilityType resultSetHoldabilityType ) {
+ this.resultSetHoldabilityType = resultSetHoldabilityType;
+ }
+
+ /**
+ * Retrieves the major version number of the underlying database.
+ *
+ * @return the underlying database's major version
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Integer getDatabaseMajorVersion() {
+ return databaseMajorVersion;
+ }
+
+ /**
+ * Sets the major version number of the underlying database.
+ *
+ * @param databaseMajorVersion the underlying database's major version
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setDatabaseMajorVersion( Integer databaseMajorVersion ) {
+ this.databaseMajorVersion = databaseMajorVersion;
+ }
+
+ /**
+ * Retrieves the minor version number of the underlying database.
+ *
+ * @return underlying database's minor version
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Integer getDatabaseMinorVersion() {
+ return databaseMinorVersion;
+ }
+
+ /**
+ * Sets the minor version number of the underlying database.
+ *
+ * @param databaseMinorVersion underlying database's minor version
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setDatabaseMinorVersion( Integer databaseMinorVersion ) {
+ this.databaseMinorVersion = databaseMinorVersion;
+ }
+
+ /**
+ * Retrieves the major JDBC version number for this driver.
+ *
+ * @return JDBC version major number
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Integer getJDBCMajorVersion() {
+ return jdbcMajorVersion;
+ }
+
+ /**
+ * Sets the major JDBC version number for this driver.
+ *
+ * @param jdbcMajorVersion JDBC version major number
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setJDBCMajorVersion( Integer jdbcMajorVersion ) {
+ this.jdbcMajorVersion = jdbcMajorVersion;
+ }
+
+ /**
+ * Retrieves the minor JDBC version number for this driver.
+ *
+ * @return JDBC version minor number
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Integer getJDBCMinorVersion() {
+ return jdbcMinorVersion;
+ }
+
+ /**
+ * Sets the minor JDBC version number for this driver.
+ *
+ * @param jdbcMinorVersion JDBC version minor number
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setJDBCMinorVersion( Integer jdbcMinorVersion ) {
+ this.jdbcMinorVersion = jdbcMinorVersion;
+ }
+
+ /**
+ * Indicates whether the SQLSTATE returned by <code>SQLException.getSQLState</code> is X/Open (now known as Open Group) SQL
+ * CLI or SQL99.
+ *
+ * @return the type of SQLSTATE; one of: sqlStateXOpen or sqlStateSQL99
+ * @since 1.4 (JDBC 3.0)
+ */
+ public SQLStateType getSQLStateType() {
+ return sqlStateType;
+ }
+
+ /**
+ * Indicates whether the SQLSTATE returned by <code>SQLException.getSQLState</code> is X/Open (now known as Open Group) SQL
+ * CLI or SQL99.
+ *
+ * @param sqlStateType the type of SQLSTATE; one of: sqlStateXOpen or sqlStateSQL99
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSQLStateType( SQLStateType sqlStateType ) {
+ this.sqlStateType = sqlStateType;
+ }
+
+ /**
+ * Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
+ *
+ * @return <code>true</code> if updates are made to a copy of the LOB; <code>false</code> if updates are made directly to the
+ * LOB
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isLocatorsUpdateCopy() {
+ return locatorsUpdateCopy;
+ }
+
+ /**
+ * Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
+ *
+ * @param locatorsUpdateCopy <code>true</code> if updates are made to a copy of the LOB; <code>false</code> if updates are
+ * made directly to the LOB
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setLocatorsUpdateCopy( Boolean locatorsUpdateCopy ) {
+ this.locatorsUpdateCopy = locatorsUpdateCopy;
+ }
+
+ /**
+ * Retrieves whether this database supports statement pooling.
+ *
+ * @return <code>true</code> if so; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Boolean isSupportsStatementPooling() {
+ return supportsStatementPooling;
+ }
+
+ /**
+ * Sets whether this database supports statement pooling.
+ *
+ * @param supportsStatementPooling <code>true</code> if so; <code>false</code> otherwise
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSupportsStatementPooling( Boolean supportsStatementPooling ) {
+ this.supportsStatementPooling = supportsStatementPooling;
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Map;
+import java.util.HashMap;
+import org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject;
+
+/**
+ * Provides database named object specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseNamedObjectBean extends CoreMetaDataBean implements DatabaseNamedObject {
+ private static final long serialVersionUID = 5784316298846262968L;
+ private String name;
+ private String remarks;
+ private Map<String, Object> extraProperties = new HashMap<String, Object>();
+
+ /**
+ * Default constructor
+ */
+ public DatabaseNamedObjectBean() {
+ }
+
+ /**
+ * Gets database named object name
+ *
+ * @return database named object name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets database named object name
+ *
+ * @param name the database named object name
+ */
+ public void setName( String name ) {
+ this.name = name;
+ }
+
+ /**
+ * Gets explanatory comment on the database named object
+ *
+ * @return explanatory comment on the database named object
+ */
+ public String getRemarks() {
+ return remarks;
+ }
+
+ /**
+ * Sets explanatory comment on the database named object
+ *
+ * @param remarks the explanatory comment on the database named object
+ */
+ public void setRemarks( String remarks ) {
+ this.remarks = remarks;
+ }
+
+ /**
+ * Gets extra (non standard) properties if provided by database.
+ *
+ * @return extra properties if provided by database
+ */
+ public Map<String, Object> getExtraProperties() {
+ return extraProperties;
+ }
+
+ /**
+ * Gets extra (non standard) property if provided by database.
+ *
+ * @param key the key
+ * @return extra property if provided by database
+ */
+ public Object getExtraProperty( String key ) {
+ return extraProperties.get(key);
+ }
+
+ /**
+ * Adds extra property
+ *
+ * @param key the key
+ * @param value the value
+ */
+ public void addExtraProperty( String key,
+ Object value ) {
+ extraProperties.put(key, value);
+ }
+
+ /**
+ * deletes extra property
+ *
+ * @param key the key
+ *
+ */
+ public void deleteExtraProperty( String key ) {
+ extraProperties.remove(key);
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,185 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.ForeignKey;
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.KeyDeferrabilityType;
+import org.jboss.dna.common.jdbc.model.api.KeyModifyRuleType;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.Table;
+
+/**
+ * Provides database table's foreing key specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ForeignKeyBean extends SchemaObjectBean implements ForeignKey {
+ private static final long serialVersionUID = 3481927472605189902L;
+ private Set<ForeignKeyColumn> columns = new HashSet<ForeignKeyColumn>();
+ private Table sourceTable;
+ private PrimaryKey sourcePrimaryKey;
+ private KeyModifyRuleType updateRule;
+ private KeyModifyRuleType deleteRule;
+ private KeyDeferrabilityType deferrability;
+
+ /**
+ * Default constructor
+ */
+ public ForeignKeyBean() {
+ }
+
+ /**
+ * Retrieves foreign key columns
+ *
+ * @return foreign key columns
+ */
+ public Set<ForeignKeyColumn> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Adds ForeignKeyColumn
+ *
+ * @param column the ForeignKeyColumn
+ */
+ public void addColumn( ForeignKeyColumn column ) {
+ columns.add(column);
+ }
+
+ /**
+ * Removes ForeignKeyColumn
+ *
+ * @param column the ForeignKeyColumn
+ */
+ public void deleteColumn( ForeignKeyColumn column ) {
+ columns.remove(column);
+ }
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ public ForeignKeyColumn findColumnByName( String columnName ) {
+ for (ForeignKeyColumn fkc : columns) {
+ if (fkc.getName().equals(columnName)) {
+ return fkc;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Returns the scope table of a foreign key.
+ *
+ * @return the scope table of a foreign key.
+ */
+ public Table getSourceTable() {
+ return sourceTable;
+ }
+
+ /**
+ * Sets the scope table of a foreign key.
+ *
+ * @param sourceTable the scope table of a foreign key.
+ */
+ public void setSourceTable( Table sourceTable ) {
+ this.sourceTable = sourceTable;
+ }
+
+ /**
+ * Returns the PK of scope table.
+ *
+ * @return the PK of scope table.
+ */
+ public PrimaryKey getSourcePrimaryKey() {
+ return sourcePrimaryKey;
+ }
+
+ /**
+ * Sets the PK of scope table.
+ *
+ * @param primaryKey the PK of scope table.
+ */
+ public void setSourcePrimaryKey( PrimaryKey primaryKey ) {
+ this.sourcePrimaryKey = primaryKey;
+ }
+
+ /**
+ * What happens to a foreign key when the primary key is updated
+ *
+ * @return what happens to a foreign key when the primary key is updated
+ */
+ public KeyModifyRuleType getUpdateRule() {
+ return updateRule;
+ }
+
+ /**
+ * What happens to a foreign key when the primary key is updated
+ *
+ * @param updateRule what happens to a foreign key when the primary key is updated
+ */
+ public void setUpdateRule( KeyModifyRuleType updateRule ) {
+ this.updateRule = updateRule;
+ }
+
+ /**
+ * What happens to a foreign key when the primary key is deleted
+ *
+ * @return what happens to a foreign key when the primary key is deleted
+ */
+ public KeyModifyRuleType getDeleteRule() {
+ return deleteRule;
+ }
+
+ /**
+ * What happens to a foreign key when the primary key is deleted
+ *
+ * @param deleteRule what happens to a foreign key when the primary key is deleted
+ */
+ public void setDeleteRule( KeyModifyRuleType deleteRule ) {
+ this.deleteRule = deleteRule;
+ }
+
+ /**
+ * Can the evaluation of foreign key constraints be deferred until commit
+ *
+ * @return the evaluation of foreign key constraints be deferred until commit
+ */
+ public KeyDeferrabilityType getDeferrability() {
+ return deferrability;
+ }
+
+ /**
+ * Can the evaluation of foreign key constraints be deferred until commit
+ *
+ * @param deferrability the evaluation of foreign key constraints be deferred until commit
+ */
+ public void setDeferrability( KeyDeferrabilityType deferrability ) {
+ this.deferrability = deferrability;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+
+/**
+ * Provides all database table foreign key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ForeignKeyColumnBean extends KeyColumnBean implements ForeignKeyColumn {
+ private static final long serialVersionUID = 2513136344022312413L;
+ private TableColumn sourceColumn;
+
+ /**
+ * Default constructor
+ */
+ public ForeignKeyColumnBean() {
+ }
+
+ /**
+ * Returns mapped source column (in PK/source table) for this foreign key column
+ *
+ * @return mapped source column (in PK/source table) for this foreign key column
+ */
+ public TableColumn getSourceColumn() {
+ return sourceColumn;
+ }
+
+ /**
+ * Sets mapped source column (in PK/source table) for this foreign key column
+ *
+ * @param sourceColumn mapped source column (in PK/source table) for this foreign key column
+ */
+ public void setSourceColumn( TableColumn sourceColumn ) {
+ this.sourceColumn = sourceColumn;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.Index;
+import org.jboss.dna.common.jdbc.model.api.IndexColumn;
+import org.jboss.dna.common.jdbc.model.api.IndexType;
+
+/**
+ * Provides all database table's index specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class IndexBean extends SchemaObjectBean implements Index {
+ private static final long serialVersionUID = -1217601426100735909L;
+ private Set<IndexColumn> columns = new HashSet<IndexColumn>();
+ private Boolean unique;
+ private IndexType indexType;
+ private Integer cardinality;
+ private Integer pages;
+ private String filterCondition;
+
+ /**
+ * Default constructor
+ */
+ public IndexBean() {
+ }
+
+ /**
+ * Retrieves index columns
+ *
+ * @return index columns
+ */
+ public Set<IndexColumn> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Adds IndexColumn
+ *
+ * @param indexColumn the IndexColumn
+ */
+ public void addColumn( IndexColumn indexColumn ) {
+ columns.add(indexColumn);
+ }
+
+ /**
+ * delete IndexColumn
+ *
+ * @param indexColumn the IndexColumn
+ */
+ public void deleteColumn( IndexColumn indexColumn ) {
+ columns.remove(indexColumn);
+ }
+
+ /**
+ * Returns index column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return index column for specified column name or null.
+ */
+ public IndexColumn findColumnByName( String columnName ) {
+ for (IndexColumn ic : columns) {
+ if (ic.getName().equals(columnName)) {
+ return ic;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Can index values be non-unique. false when TYPE is tableIndexStatistic.
+ *
+ * @return true if index values can be non-unique.
+ */
+ public Boolean isUnique() {
+ return unique;
+ }
+
+ /**
+ * Can index values be non-unique. false when TYPE is tableIndexStatistic.
+ *
+ * @param unique true if index values can be non-unique.
+ */
+ public void setUnique( Boolean unique ) {
+ this.unique = unique;
+ }
+
+ /**
+ * Gets index type
+ *
+ * @return index type
+ */
+ public IndexType getIndexType() {
+ return indexType;
+ }
+
+ /**
+ * Sets index type
+ *
+ * @param indexType index type
+ */
+ public void setIndexType( IndexType indexType ) {
+ this.indexType = indexType;
+ }
+
+ /**
+ * When TYPE is tableIndexStatistic, then this is the number of rows in the table; otherwise, it is the number of unique
+ * values in the index.
+ *
+ * @return the number of rows in the table if index type is STATISTICS; otherwise, the number of unique values in the index.
+ */
+ public Integer getCardinality() {
+ return cardinality;
+ }
+
+ /**
+ * When TYPE is tableIndexStatistic, then this is the number of rows in the table; otherwise, it is the number of unique
+ * values in the index.
+ *
+ * @param cardinality the number of rows in the table if index type is STATISTICS; otherwise, the number of unique values in
+ * the index.
+ */
+ public void setCardinality( Integer cardinality ) {
+ this.cardinality = cardinality;
+ }
+
+ /**
+ * When TYPE is tableIndexStatisic then this is the number of pages used for the table, otherwise it is the number of pages
+ * used for the current index.
+ *
+ * @return the number of pages used for the table if index type is STATISTICS; otherwise the number of pages used for the
+ * current index.
+ */
+ public Integer getPages() {
+ return pages;
+ }
+
+ /**
+ * When TYPE is tableIndexStatisic then this is the number of pages used for the table, otherwise it is the number of pages
+ * used for the current index.
+ *
+ * @param pages the number of pages used for the table if index type is STATISTICS; otherwise the number of pages used for the
+ * current index.
+ */
+ public void setPages( Integer pages ) {
+ this.pages = pages;
+ }
+
+ /**
+ * Returns the filter condition, if any. (may be null)
+ *
+ * @return the filter condition, if any. (may be null)
+ */
+ public String getFilterCondition() {
+ return filterCondition;
+ }
+
+ /**
+ * Sets the filter condition, if any. (may be null)
+ *
+ * @param filterCondition the filter condition, if any. (may be null)
+ */
+ public void setFilterCondition( String filterCondition ) {
+ this.filterCondition = filterCondition;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.IndexColumn;
+import org.jboss.dna.common.jdbc.model.api.SortSequenceType;
+
+/**
+ * Provides all database table index column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class IndexColumnBean extends KeyColumnBean implements IndexColumn {
+ private static final long serialVersionUID = 6858478735473652523L;
+ private SortSequenceType sortSequenceType;
+
+ /**
+ * Default constructor
+ */
+ public IndexColumnBean() {
+ }
+
+ /**
+ * Gets column sort sequence type
+ *
+ * @return column sort sequence type
+ */
+ public SortSequenceType getSortSequenceType() {
+ return sortSequenceType;
+ }
+
+ /**
+ * Sets column sort sequence type
+ *
+ * @param sortSequenceType column sort sequence type
+ */
+ public void setSortSequenceType( SortSequenceType sortSequenceType ) {
+ this.sortSequenceType = sortSequenceType;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.KeyColumn;
+
+/**
+ * Provides all database table key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class KeyColumnBean extends TableColumnBean implements KeyColumn {
+ private static final long serialVersionUID = -554546774511936892L;
+
+ /**
+ * Default constructor
+ */
+ public KeyColumnBean() {
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ParameterBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ParameterBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ParameterBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Parameter;
+import org.jboss.dna.common.jdbc.model.api.ParameterIoType;
+
+/**
+ * Provides all SP column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ParameterBean extends ColumnBean implements Parameter {
+ private static final long serialVersionUID = -154398910715869384L;
+ private ParameterIoType parameterIoType;
+ private Integer scale;
+
+ /**
+ * Default constructor
+ */
+ public ParameterBean() {
+ }
+
+ /**
+ * Gets stored procedure parameter I/O type
+ *
+ * @return stored procedure parameter I/O type
+ */
+ public ParameterIoType getIoType() {
+ return parameterIoType;
+ }
+
+ /**
+ * Sets stored procedure parameter I/O type
+ *
+ * @param parameterIoType stored procedure parameter I/O type
+ */
+ public void setIoType( ParameterIoType parameterIoType ) {
+ this.parameterIoType = parameterIoType;
+ }
+
+ /**
+ * Returns parameter scale if appropriate
+ *
+ * @return scale if appropriate
+ */
+ public Integer getScale() {
+ return scale;
+ }
+
+ /**
+ * Sets parameter scale if appropriate
+ *
+ * @param scale the scale if appropriate
+ */
+ public void setScale( Integer scale ) {
+ this.scale = scale;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKeyColumn;
+
+/**
+ * Provides database table's primary key specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrimaryKeyBean extends SchemaObjectBean implements PrimaryKey {
+ private static final long serialVersionUID = -6620964715120791723L;
+ private Set<PrimaryKeyColumn> columns = new HashSet<PrimaryKeyColumn>();
+
+ /**
+ * Default constructor
+ */
+ public PrimaryKeyBean() {
+ }
+
+ /**
+ * Retrieves primary key columns
+ *
+ * @return primary key columns
+ */
+ public Set<PrimaryKeyColumn> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Adds PrimaryKeyColumn
+ *
+ * @param primaryKeyColumn the PrimaryKeyColumn
+ */
+ public void addColumn( PrimaryKeyColumn primaryKeyColumn ) {
+ columns.add(primaryKeyColumn);
+ }
+
+ /**
+ * deletes PrimaryKeyColumn
+ *
+ * @param primaryKeyColumn the PrimaryKeyColumn
+ */
+ public void deleteColumn( PrimaryKeyColumn primaryKeyColumn ) {
+ columns.remove(primaryKeyColumn);
+ }
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ public PrimaryKeyColumn findColumnByName( String columnName ) {
+ for (PrimaryKeyColumn pkc : columns) {
+ if (pkc.getName().equals(columnName)) {
+ return pkc;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.PrimaryKeyColumn;
+
+/**
+ * Provides all database table primary key column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrimaryKeyColumnBean extends KeyColumnBean implements PrimaryKeyColumn {
+ private static final long serialVersionUID = -4638854444046770534L;
+
+ /**
+ * Default constructor
+ */
+ public PrimaryKeyColumnBean() {
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+import org.jboss.dna.common.jdbc.model.api.PrivilegeType;
+
+/**
+ * Provides all database privilege specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrivilegeBean extends CoreMetaDataBean implements Privilege {
+ private static final long serialVersionUID = -163129768802977718L;
+ private PrivilegeType privilegeType;
+ private String grantor;
+ private String grantee;
+ private String name;
+ private Boolean grantable;
+ private Boolean unknownGrantable;
+
+ /**
+ * Default constructor
+ */
+ public PrivilegeBean() {
+ }
+
+ /**
+ * Returns privilege type
+ *
+ * @return privilege type
+ */
+ public PrivilegeType getPrivilegeType() {
+ return privilegeType;
+ }
+
+ /**
+ * Sets privilege type
+ *
+ * @param privilegeType the privilege type
+ */
+ public void setPrivilegeType( PrivilegeType privilegeType ) {
+ this.privilegeType = privilegeType;
+ }
+
+ /**
+ * Return grantor of access (may be <code>null</code>)
+ *
+ * @return grantor of access (may be <code>null</code>)
+ */
+ public String getGrantor() {
+ return grantor;
+ }
+
+ /**
+ * Sets grantor of access (may be <code>null</code>)
+ *
+ * @param grantor the grantor of access (may be <code>null</code>)
+ */
+ public void setGrantor( String grantor ) {
+ this.grantor = grantor;
+ }
+
+ /**
+ * Return grantee of access (may be <code>null</code>)
+ *
+ * @return grantee of access (may be <code>null</code>)
+ */
+ public String getGrantee() {
+ return grantee;
+ }
+
+ /**
+ * Sets grantee of access (may be <code>null</code>)
+ *
+ * @param grantee the grantee of access (may be <code>null</code>)
+ */
+ public void setGrantee( String grantee ) {
+ this.grantee = grantee;
+ }
+
+ /**
+ * Return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ *
+ * @return name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ *
+ * @param name the name of access allowed (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ */
+ public void setName( String name ) {
+ this.name = name;
+ }
+
+ /**
+ * Return true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ *
+ * @return true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ */
+ public Boolean isGrantable() {
+ return grantable;
+ }
+
+ /**
+ * Sets true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ *
+ * @param grantable true if grantee is permitted to grant to others, false otherwise (even if unknown).
+ */
+ public void setGrantable( Boolean grantable ) {
+ this.grantable = grantable;
+ }
+
+ /**
+ * Return true if it is unknown: grantee is permitted to grant to others or not
+ *
+ * @return true if it is unknown: grantee is permitted to grant to others or not
+ */
+ public Boolean isUnknownGrantable() {
+ return unknownGrantable;
+ }
+
+ /**
+ * sets true if it is unknown: grantee is permitted to grant to others or not
+ *
+ * @param unknownGrantable true if it is unknown: grantee is permitted to grant to others or not
+ */
+ public void setUnknownGrantable( Boolean unknownGrantable ) {
+ this.unknownGrantable = unknownGrantable;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Reference;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.Table;
+
+/**
+ * Provides all database table REF column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ReferenceBean extends CoreMetaDataBean implements Reference {
+ private static final long serialVersionUID = -4520163631157669283L;
+ private Table sourceTable;
+ private SqlType sourceDataType;
+
+ /**
+ * Default constructor
+ */
+ public ReferenceBean() {
+ }
+
+ /**
+ * Returns table name that this the scope of a reference attribure
+ *
+ * @return table name that this the scope of a reference attribure
+ */
+ public Table getSourceTable() {
+ return sourceTable;
+ }
+
+ /**
+ * Sets table name that this the scope of a reference attribure
+ *
+ * @param sourceTable table name that this the scope of a reference attribure
+ */
+ public void setSourceTable( Table sourceTable ) {
+ this.sourceTable = sourceTable;
+ }
+
+ /**
+ * Returns source type of a distinct type or user-generated Ref type.
+ *
+ * @return source type of a distinct type or user-generated Ref type,
+ */
+ public SqlType getSourceDataType() {
+ return sourceDataType;
+ }
+
+ /**
+ * Sets source type of a distinct type or user-generated Ref type.
+ *
+ * @param sourceDataType source type of a distinct type or user-generated Ref type,
+ */
+ public void setSourceDataType( SqlType sourceDataType ) {
+ this.sourceDataType = sourceDataType;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+
+/**
+ * Provides database schema specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SchemaBean extends DatabaseNamedObjectBean implements Schema {
+ private static final long serialVersionUID = -3277162949797951267L;
+ private Catalog catalog;
+
+ /**
+ * Default constructor
+ */
+ public SchemaBean() {
+ }
+
+ /**
+ * Gets database catalog
+ *
+ * @return database catalog
+ */
+ public Catalog getCatalog() {
+ return catalog;
+ }
+
+ /**
+ * Sets database catalog
+ *
+ * @param catalog the database catalog
+ */
+ public void setCatalog( Catalog catalog ) {
+ this.catalog = catalog;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+import org.jboss.dna.common.jdbc.model.api.SchemaObject;
+
+/**
+ * Provides database schema object specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SchemaObjectBean extends DatabaseNamedObjectBean implements SchemaObject {
+ private static final long serialVersionUID = -2361937039721273606L;
+ private Catalog catalog;
+ private Schema schema;
+
+ /**
+ * Default constructor
+ */
+ public SchemaObjectBean() {
+ }
+
+ /**
+ * Gets database catalog
+ *
+ * @return database catalog
+ */
+ public Catalog getCatalog() {
+ return catalog;
+ }
+
+ /**
+ * Sets database catalog
+ *
+ * @param catalog the database catalog
+ */
+ public void setCatalog( Catalog catalog ) {
+ this.catalog = catalog;
+ }
+
+ /**
+ * Gets database schema
+ *
+ * @return database schema
+ */
+ public Schema getSchema() {
+ return schema;
+ }
+
+ /**
+ * Sets database schema
+ *
+ * @param schema the database schema
+ */
+ public void setSchema( Schema schema ) {
+ this.schema = schema;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.SqlTypeConversionPair;
+
+/**
+ * Provides RDBMS supported SQL type valid conversion pair.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SqlTypeConversionPairBean extends CoreMetaDataBean implements SqlTypeConversionPair {
+ private static final long serialVersionUID = -2111832789576864971L;
+ private SqlType srcType;
+ private SqlType destType;
+
+ /**
+ * Default constructor
+ */
+ public SqlTypeConversionPairBean() {
+ }
+
+ /**
+ * Gets valid <from> SQL Type
+ *
+ * @return valid <from> SQL Type
+ */
+ public SqlType getSrcType() {
+ return srcType;
+ }
+
+ /**
+ * Sets valid source SQL Type
+ *
+ * @param srcType the source SQL Type
+ */
+ public void setSrcType( SqlType srcType ) {
+ this.srcType = srcType;
+ }
+
+ /**
+ * Gets valid destination SQL Type
+ *
+ * @return valid dewstination SQL Type
+ */
+ public SqlType getDestType() {
+ return destType;
+ }
+
+ /**
+ * Sets valid destination SQL Type
+ *
+ * @param destType the destination SQL Type
+ */
+ public void setDestType( SqlType destType ) {
+ this.destType = destType;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,327 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.NullabilityType;
+import org.jboss.dna.common.jdbc.model.api.SearchabilityType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.SqlTypeInfo;
+
+/**
+ * Provides RDBMS supported standatd SQL types info.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SqlTypeInfoBean extends DatabaseNamedObjectBean implements SqlTypeInfo {
+ private static final long serialVersionUID = -3336885010975318256L;
+ private String localizedTypeName;
+ private NullabilityType nullabilityType;
+ private SqlType sqlType;
+ private Long precision;
+ private Boolean fixedPrecisionScale;
+ private Integer numberPrecisionRadix;
+ private Integer minScale;
+ private Integer maxScale;
+ private String literalPrefix;
+ private String literalSuffix;
+ private String createParams;
+ private Boolean caseSensitive;
+ private SearchabilityType searchabilityType;
+ private Boolean unsigned;
+ private Boolean autoIncrement;
+
+ /**
+ * Default constructor
+ */
+ public SqlTypeInfoBean() {
+ }
+
+ /**
+ * Returns localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
+ *
+ * @return localized version of type name (may be null)
+ */
+ public String getLocalizedTypeName() {
+ return localizedTypeName;
+ }
+
+ /**
+ * Sets localized version of type name (may be null). Type name is returned by DatabaseNamedObject.getName () method.
+ *
+ * @param localizedTypeName localized version of type name (may be null)
+ */
+ public void setLocalizedTypeName( String localizedTypeName ) {
+ this.localizedTypeName = localizedTypeName;
+ }
+
+ /**
+ * Gets SQL type nullability
+ *
+ * @return SQL type nullability
+ */
+ public NullabilityType getNullabilityType() {
+ return nullabilityType;
+ }
+
+ /**
+ * Sets SQL type nullability
+ *
+ * @param nullabilityType SQL type nullability
+ */
+ public void setNullabilityType( NullabilityType nullabilityType ) {
+ this.nullabilityType = nullabilityType;
+ }
+
+ /**
+ * Gets SQL type from java.sql.Types
+ *
+ * @return SQL type from java.sql.Types
+ */
+ public SqlType getSqlType() {
+ return sqlType;
+ }
+
+ /**
+ * Sets SQL type from java.sql.Types
+ *
+ * @param sqlType the SQL type from java.sql.Types
+ */
+ public void setSqlType( SqlType sqlType ) {
+ this.sqlType = sqlType;
+ }
+
+ /**
+ * Gets precision (number of fractional digits/scale) if applicable otherwise 0.
+ *
+ * @return precision if applicable otherwise 0
+ */
+ public Long getPrecision() {
+ return precision;
+ }
+
+ /**
+ * Sets precision (number of fractional digits/scale) if applicable otherwise 0.
+ *
+ * @param precision precision if applicable otherwise 0
+ */
+ public void setPrecision( Long precision ) {
+ this.precision = precision;
+ }
+
+ /**
+ * Returns true if sql type can be a money value, for instance
+ *
+ * @return true if sql type can be a money value, for instance
+ */
+ public Boolean isFixedPrecisionScale() {
+ return fixedPrecisionScale;
+ }
+
+ /**
+ * Sets true if sql type can be a money value, for instance
+ *
+ * @param fixedPrecisionScale true if sql type can be a money value, for instance
+ */
+ public void setFixedPrecisionScale( Boolean fixedPrecisionScale ) {
+ this.fixedPrecisionScale = fixedPrecisionScale;
+ }
+
+ /**
+ * Returns sql type precision radix (usually 2 or 10)
+ *
+ * @return sql type precision radix (usually 2 or 10)
+ */
+ public Integer getNumberPrecisionRadix() {
+ return numberPrecisionRadix;
+ }
+
+ /**
+ * sets sql type precision radix (usually 2 or 10)
+ *
+ * @param numberPrecisionRadix the sql type precision radix (usually 2 or 10)
+ */
+ public void setNumberPrecisionRadix( Integer numberPrecisionRadix ) {
+ this.numberPrecisionRadix = numberPrecisionRadix;
+ }
+
+ /**
+ * Returns minimum scale supported
+ *
+ * @return minimum scale supported
+ */
+ public Integer getMinScale() {
+ return minScale;
+ }
+
+ /**
+ * Sets minimum scale supported
+ *
+ * @param minScale minimum scale supported
+ */
+ public void setMinScale( Integer minScale ) {
+ this.minScale = minScale;
+ }
+
+ /**
+ * Returns maximum scale supported
+ *
+ * @return maximum scale supported
+ */
+ public Integer getMaxScale() {
+ return maxScale;
+ }
+
+ /**
+ * Sets maximum scale supported
+ *
+ * @param maxScale the maximum scale supported
+ */
+ public void setMaxScale( Integer maxScale ) {
+ this.maxScale = maxScale;
+ }
+
+ /**
+ * Returns prefix used to quote a literal (may be null)
+ *
+ * @return prefix used to quote a literal (may be null)
+ */
+ public String getLiteralPrefix() {
+ return literalPrefix;
+ }
+
+ /**
+ * Sets prefix used to quote a literal (may be null)
+ *
+ * @param literalPrefix the prefix used to quote a literal (may be null)
+ */
+ public void setLiteralPrefix( String literalPrefix ) {
+ this.literalPrefix = literalPrefix;
+ }
+
+ /**
+ * Returns suffix used to quote a literal (may be null)
+ *
+ * @return suffix used to quote a literal (may be null)
+ */
+ public String getLiteralSuffix() {
+ return literalSuffix;
+ }
+
+ /**
+ * Sets suffix used to quote a literal (may be null)
+ *
+ * @param literalSuffix the suffix used to quote a literal (may be null)
+ */
+ public void setLiteralSuffix( String literalSuffix ) {
+ this.literalSuffix = literalSuffix;
+ }
+
+ /**
+ * Returns parameters used in creating the type (may be null)
+ *
+ * @return parameters used in creating the type (may be null)
+ */
+ public String getCreateParams() {
+ return createParams;
+ }
+
+ /**
+ * Sets parameters used in creating the type (may be null)
+ *
+ * @param createParams the parameters used in creating the type (may be null)
+ */
+ public void setCreateParams( String createParams ) {
+ this.createParams = createParams;
+ }
+
+ /**
+ * Is sql type case sensitive
+ *
+ * @return true if sql type case sensitive
+ */
+ public Boolean isCaseSensitive() {
+ return caseSensitive;
+ }
+
+ /**
+ * Is sql type case sensitive
+ *
+ * @param caseSensitive the true if sql type case sensitive
+ */
+ public void setCaseSensitive( Boolean caseSensitive ) {
+ this.caseSensitive = caseSensitive;
+ }
+
+ /**
+ * Returns sql type searchability
+ *
+ * @return sql type searchability
+ */
+ public SearchabilityType getSearchabilityType() {
+ return searchabilityType;
+ }
+
+ /**
+ * Sets sql type searchability
+ *
+ * @param searchabilityType the sql type searchability
+ */
+ public void setSearchabilityType( SearchabilityType searchabilityType ) {
+ this.searchabilityType = searchabilityType;
+ }
+
+ /**
+ * Returns true if sql type is unsigned
+ *
+ * @return true if sql type is unsigned
+ */
+ public Boolean isUnsigned() {
+ return unsigned;
+ }
+
+ /**
+ * Sets true if sql type is unsigned
+ *
+ * @param unsigned true if sql type is unsigned
+ */
+ public void setUnsigned( Boolean unsigned ) {
+ this.unsigned = unsigned;
+ }
+
+ /**
+ * Returns true if sql type can be used for an auto-increment value.
+ *
+ * @return true if sql type can be used for an auto-increment value.
+ */
+ public Boolean isAutoIncrement() {
+ return autoIncrement;
+ }
+
+ /**
+ * Sets true if sql type can be used for an auto-increment value.
+ *
+ * @param autoIncrement true if sql type can be used for an auto-increment value.
+ */
+ public void setAutoIncrement( Boolean autoIncrement ) {
+ this.autoIncrement = autoIncrement;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.Parameter;
+import org.jboss.dna.common.jdbc.model.api.StoredProcedure;
+import org.jboss.dna.common.jdbc.model.api.StoredProcedureResultType;
+
+/**
+ * Provides all core database SPe specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class StoredProcedureBean extends SchemaObjectBean implements StoredProcedure {
+ private static final long serialVersionUID = 8530431073036932292L;
+ private Set<Parameter> columns = new HashSet<Parameter>();
+ private StoredProcedureResultType resultType;
+
+ /**
+ * Default constructor
+ */
+ public StoredProcedureBean() {
+ }
+
+ /**
+ * Gets stored procedure result type
+ *
+ * @return stored procedure result type
+ */
+ public StoredProcedureResultType getResultType() {
+ return resultType;
+ }
+
+ /**
+ * Sets stored procedure result type
+ *
+ * @param resultType the stored procedure result type
+ */
+ public void setResultType( StoredProcedureResultType resultType ) {
+ this.resultType = resultType;
+ }
+
+ /**
+ * Gets stored procedure columns
+ *
+ * @return a set of stored procedure columns.
+ */
+ public Set<Parameter> getParameters() {
+ return columns;
+ }
+
+ /**
+ * Adds Parameter
+ *
+ * @param parameter the Parameter
+ */
+ public void addParameter( Parameter parameter ) {
+ columns.add(parameter);
+ }
+
+ /**
+ * deletes Parameter
+ *
+ * @param parameter the Parameter
+ */
+ public void deleteParameter( Parameter parameter ) {
+ columns.remove(parameter);
+ }
+
+ /**
+ * Returns stored procedure parameter for specified name or null
+ *
+ * @param parameterName the name of parameter
+ * @return stored procedure parameter for specified name or null.
+ */
+ public Parameter findParameterByName( String parameterName ) {
+ for (Parameter p : columns) {
+ if (p.getName().equals(parameterName)) {
+ return p;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,477 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifier;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifierScopeType;
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.ForeignKey;
+import org.jboss.dna.common.jdbc.model.api.Index;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+import org.jboss.dna.common.jdbc.model.api.Table;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+import org.jboss.dna.common.jdbc.model.api.TableType;
+
+/**
+ * Provides all core database table specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class TableBean extends SchemaObjectBean implements Table {
+ private static final long serialVersionUID = -1315274844163173964L;
+ private Set<TableColumn> columns = new HashSet<TableColumn>();
+ private Set<ForeignKey> foreignKeys = new HashSet<ForeignKey>();
+ private Set<Index> indexes = new HashSet<Index>();
+ private Set<TableColumn> versionColumns = new HashSet<TableColumn>();
+ private Set<Privilege> privileges = new HashSet<Privilege>();
+ private Set<BestRowIdentifier> bestRowIdentifiers = new HashSet<BestRowIdentifier>();
+ private TableType tableType;
+ private Catalog typeCatalog;
+ private Schema typeSchema;
+ private String typeName;
+ private String selfReferencingColumnName;
+ private String referenceGeneration;
+ private PrimaryKey primaryKey;
+ private Table superTable;
+
+ /**
+ * Default constructor
+ */
+ public TableBean() {
+ }
+
+ /**
+ * Returns type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ *
+ * @return type of table.
+ */
+ public TableType getTableType() {
+ return tableType;
+ }
+
+ /**
+ * Sets type of table such as: "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ *
+ * @param tableType the type of table.
+ */
+ public void setTableType( TableType tableType ) {
+ this.tableType = tableType;
+ }
+
+ /**
+ * Gets type catalog
+ *
+ * @return types catalog (may be <code>null</code>)
+ */
+ public Catalog getTypeCatalog() {
+ return typeCatalog;
+ }
+
+ /**
+ * Sets type catalog
+ *
+ * @param typeCatalog the types catalog (may be <code>null</code>)
+ */
+ public void setTypeCatalog( Catalog typeCatalog ) {
+ this.typeCatalog = typeCatalog;
+ }
+
+ /**
+ * Gets type schema
+ *
+ * @return types schema (may be <code>null</code>)
+ */
+ public Schema getTypeSchema() {
+ return typeSchema;
+ }
+
+ /**
+ * Sets type schema
+ *
+ * @param typeSchema the types schema (may be <code>null</code>)
+ */
+ public void setTypeSchema( Schema typeSchema ) {
+ this.typeSchema = typeSchema;
+ }
+
+ /**
+ * Gets type name
+ *
+ * @return types name (may be <code>null</code>)
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ /**
+ * Sets type name
+ *
+ * @param typeName types name (may be <code>null</code>)
+ */
+ public void setTypeName( String typeName ) {
+ this.typeName = typeName;
+ }
+
+ /**
+ * Gets name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ *
+ * @return name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ */
+ public String getSelfReferencingColumnName() {
+ return selfReferencingColumnName;
+ }
+
+ /**
+ * Sets name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ *
+ * @param selfReferencingColumnName the name of the designated "identifier" column of a typed table (may be <code>null</code>)
+ */
+ public void setSelfReferencingColumnName( String selfReferencingColumnName ) {
+ this.selfReferencingColumnName = selfReferencingColumnName;
+ }
+
+ /**
+ * specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be
+ * <code>null</code>)
+ *
+ * @return how values in getSelfReferencingColumnName () are created.
+ */
+ public String getReferenceGeneration() {
+ return referenceGeneration;
+ }
+
+ /**
+ * specifies how values in getSelfReferencingColumnName () are created. Values are "SYSTEM", "USER", "DERIVED". (may be
+ * <code>null</code>)
+ *
+ * @param referenceGeneration how values in getSelfReferencingColumnName () are created.
+ */
+ public void setReferenceGeneration( String referenceGeneration ) {
+ this.referenceGeneration = referenceGeneration;
+ }
+
+ /**
+ * Gets a set of table columns
+ *
+ * @return a set of table columns.
+ */
+ public Set<TableColumn> getColumns() {
+ return columns;
+ }
+
+ /**
+ * Adds TableColumn
+ *
+ * @param column the TableColumn
+ */
+ public void addColumn( TableColumn column ) {
+ columns.add(column);
+ }
+
+ /**
+ * deletes TableColumn
+ *
+ * @param column the TableColumn
+ */
+ public void deleteColumn( TableColumn column ) {
+ columns.remove(column);
+ }
+
+ /**
+ * Returns table column for specified column name or null
+ *
+ * @param columnName the name of column
+ * @return table column for specified column name or null.
+ */
+ public TableColumn findColumnByName( String columnName ) {
+ for (TableColumn c : columns) {
+ if (c.getName().equals(columnName)) {
+ return c;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Gets a table primary key
+ *
+ * @return a table primary key.
+ */
+ public PrimaryKey getPrimaryKey() {
+ return primaryKey;
+ }
+
+ /**
+ * Sets a table primary key
+ *
+ * @param primaryKey the table primary key.
+ */
+ public void setPrimaryKey( PrimaryKey primaryKey ) {
+ this.primaryKey = primaryKey;
+ }
+
+ /**
+ * Gets a set of table foreign key columns
+ *
+ * @return a set of table foreign keys.
+ */
+ public Set<ForeignKey> getForeignKeys() {
+ return foreignKeys;
+ }
+
+ /**
+ * adds ForeignKey
+ *
+ * @param foreignKey the ForeignKey
+ */
+ public void addForeignKey( ForeignKey foreignKey ) {
+ foreignKeys.add(foreignKey);
+ }
+
+ /**
+ * deletes ForeignKey
+ *
+ * @param foreignKey the ForeignKey
+ */
+ public void deleteForeignKey( ForeignKey foreignKey ) {
+ foreignKeys.remove(foreignKey);
+ }
+
+ /**
+ * Returns table foreign key for specified name or null
+ *
+ * @param fkName the name of foreign key
+ * @return table foreign key for specified name or null.
+ */
+ public ForeignKey findForeignKeyByName( String fkName ) {
+ for (ForeignKey fk : foreignKeys) {
+ if (fk.getName().equals(fkName)) {
+ return fk;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Gets a set of table indexes
+ *
+ * @return a set of table indexes.
+ */
+ public Set<Index> getIndexes() {
+ return indexes;
+ }
+
+ /**
+ * adds Index
+ *
+ * @param index the Index
+ */
+ public void addIndex( Index index ) {
+ indexes.add(index);
+ }
+
+ /**
+ * deletes Index
+ *
+ * @param index the Index
+ */
+ public void deleteIndex( Index index ) {
+ indexes.remove(index);
+ }
+
+ /**
+ * Returns table index for specified name or null
+ *
+ * @param indexName the name of index
+ * @return table index for specified name or null.
+ */
+ public Index findIndexByName( String indexName ) {
+ for (Index i : indexes) {
+ if (i.getName().equals(indexName)) {
+ return i;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Gets a set of table version columns
+ *
+ * @return a set of table version columns.
+ */
+ public Set<TableColumn> getVersionColumns() {
+ return versionColumns;
+ }
+
+ /**
+ * adds version column
+ *
+ * @param tableColumn the TableColumn
+ */
+ public void addVersionColumn( TableColumn tableColumn ) {
+ versionColumns.add(tableColumn);
+ }
+
+ /**
+ * deletes version column
+ *
+ * @param tableColumn the version column
+ */
+ public void deleteVersionColumn( TableColumn tableColumn ) {
+ versionColumns.remove(tableColumn);
+ }
+
+ /**
+ * Returns table version column for specified name or null
+ *
+ * @param columnName the name of Version Column
+ * @return table Version Column for specified name or null.
+ */
+ public TableColumn findVersionColumnByName( String columnName ) {
+ for (TableColumn c : versionColumns) {
+ if (c.getName().equals(columnName)) {
+ return c;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Gets table privileges.
+ *
+ * @return set of table privileges
+ */
+ public Set<Privilege> getPrivileges() {
+ return privileges;
+ }
+
+ /**
+ * Adds table priviledge
+ *
+ * @param privilege the table priviledge
+ */
+ public void addPrivilege( Privilege privilege ) {
+ privileges.add(privilege);
+ }
+
+ /**
+ * Deletes table priviledge
+ *
+ * @param privilege the table priviledge
+ */
+ public void deletePrivilege( Privilege privilege ) {
+ privileges.remove(privilege);
+ }
+
+ /**
+ * Searches priviledge by name
+ *
+ * @param priviledgeName the priviledge name to search
+ * @return priviledge if found, otherwise return null
+ */
+ public Privilege findPriviledgeByName( String priviledgeName ) {
+ for (Privilege p : privileges) {
+ if (p.getName().equals(priviledgeName)) {
+ return p;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ /**
+ * Retrieves a set of descriptions of a table's optimal set of columns that uniquely identifies a row in temporary scopes.
+ *
+ * @return BestRowIdentifier set that uniquely identifies a row in scopes.
+ */
+ public Set<BestRowIdentifier> getBestRowIdentifiers() {
+ return bestRowIdentifiers;
+ }
+
+ /**
+ * Adds BestRowIdentifier
+ *
+ * @param bestRowIdentifier the BestRowIdentifier
+ */
+ public void addBestRowIdentifier( BestRowIdentifier bestRowIdentifier ) {
+ bestRowIdentifiers.add(bestRowIdentifier);
+ }
+
+ /**
+ * deletes BestRowIdentifier
+ *
+ * @param bestRowIdentifier the BestRowIdentifier
+ */
+ public void deleteBestRowIdentifier( BestRowIdentifier bestRowIdentifier ) {
+ bestRowIdentifiers.remove(bestRowIdentifier);
+ }
+
+ /**
+ * Searches the BestRowIdentifier by scope
+ *
+ * @param scopeType the scope of best row identifier
+ * @return BestRowIdentifier if any
+ */
+ public BestRowIdentifier findBestRowIdentifierByScopeType( BestRowIdentifierScopeType scopeType ) {
+ for (BestRowIdentifier bri : bestRowIdentifiers) {
+ if (bri.getScopeType().equals(scopeType)) {
+ return bri;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves a description of the table hierarchies defined in a particular schema in this database. Only the immediate super
+ * type/ sub type relationship is modeled.
+ *
+ * @return super table for this table
+ * @since 1.4 (JDBC 3.0)
+ */
+ public Table getSuperTable() {
+ return superTable;
+ }
+
+ /**
+ * Sets a description of the table hierarchies defined in a particular schema in this database. Only the immediate super type/
+ * sub type relationship is modeled.
+ *
+ * @param superTable the super table for this table
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSuperTable( Table superTable ) {
+ this.superTable = superTable;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.ColumnPseudoType;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+import org.jboss.dna.common.jdbc.model.api.Reference;
+
+/**
+ * Provides all database table column specific metadata.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class TableColumnBean extends ColumnBean implements TableColumn {
+ private static final long serialVersionUID = -1719977563697808831L;
+ private Boolean bestRowIdentifier;
+ private ColumnPseudoType pseudoType;
+ private Reference reference;
+ private Boolean versionColumn;
+ private Boolean primaryKeyColumn;
+ private Boolean foreignKeyColumn;
+ private Boolean indexColumn;
+
+ /**
+ * Default constructor
+ */
+ public TableColumnBean() {
+ }
+
+ /**
+ * Is this column the part of Best Row Identifier in any scope?
+ *
+ * @return true if this column is the part of Best Row Identifier in any scope, otherwise return false (even if unknown)
+ */
+ public Boolean isBestRowIdentifier() {
+ return bestRowIdentifier;
+ }
+
+ /**
+ * Is this column the part of Best Row Identifier in any scope?
+ *
+ * @param bestRowIdentifier true if this column is the part of Best Row Identifier in any scope, otherwise return false (even
+ * if unknown)
+ */
+ public void setBestRowIdentifier( Boolean bestRowIdentifier ) {
+ this.bestRowIdentifier = bestRowIdentifier;
+ }
+
+ /**
+ * Return column's pseudo type
+ *
+ * @return column's pseudo type
+ */
+ public ColumnPseudoType getPseudoType() {
+ return pseudoType;
+ }
+
+ /**
+ * Sets column's pseudo type
+ *
+ * @param pseudoType the column's pseudo type
+ */
+ public void setPseudoType( ColumnPseudoType pseudoType ) {
+ this.pseudoType = pseudoType;
+ }
+
+ /**
+ * Returns column reference if datatype is REF
+ *
+ * @return column reference if datatype is REF
+ */
+ public Reference getReference() {
+ return reference;
+ }
+
+ /**
+ * Sets column reference if datatype is REF
+ *
+ * @param reference the column reference if datatype is REF
+ */
+ public void setReference( Reference reference ) {
+ this.reference = reference;
+ }
+
+ /**
+ * Retrieves true if column is automatically updated when any value in a row is updated. If it retrieves true then column can
+ * be cast to VersionColumn.
+ *
+ * @return true if column is automatically updated when any value in a row is updated, return false overwise.
+ */
+ public Boolean isVersionColumn() {
+ return versionColumn;
+ }
+
+ /**
+ * Sets true if column is automatically updated when any value in a row is updated. If it retrieves true then column can be
+ * cast to VersionColumn.
+ *
+ * @param versionColumn true if column is automatically updated when any value in a row is updated, return false overwise.
+ */
+ public void setVersionColumn( Boolean versionColumn ) {
+ this.versionColumn = versionColumn;
+ }
+
+ /**
+ * Retrieves true if column is part of primary key.
+ *
+ * @return true if column is part of primary key, return false overwise.
+ */
+ public Boolean isPrimaryKeyColumn() {
+ return primaryKeyColumn;
+ }
+
+ /**
+ * Sets true if column is part of primary key.
+ *
+ * @param primaryKeyColumn true if column is part of primary key, return false overwise.
+ */
+ public void setPrimaryKeyColumn( Boolean primaryKeyColumn ) {
+ this.primaryKeyColumn = primaryKeyColumn;
+ }
+
+ /**
+ * Retrieves true if column is part of foreign key.
+ *
+ * @return true if column is part of foreign key, return false overwise.
+ */
+ public Boolean isForeignKeyColumn() {
+ return foreignKeyColumn;
+ }
+
+ /**
+ * Sets true if column is part of foreign key.
+ *
+ * @param foreignKeyColumn true if column is part of foreign key, return false overwise.
+ */
+ public void setForeignKeyColumn( Boolean foreignKeyColumn ) {
+ this.foreignKeyColumn = foreignKeyColumn;
+ }
+
+ /**
+ * Retrieves true if column is part of any index.
+ *
+ * @return true if column is part of any index, return false overwise.
+ */
+ public Boolean isIndexColumn() {
+ return indexColumn;
+ }
+
+ /**
+ * Sets true if column is part of any index.
+ *
+ * @param indexColumn true if column is part of any index, return false overwise.
+ */
+ public void setIndexColumn( Boolean indexColumn ) {
+ this.indexColumn = indexColumn;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.api.TableType;
+
+/**
+ * Provides database table type specific metadata.
+ * <P>
+ * The table type is:
+ * <OL>
+ * <LI><B>TABLE_TYPE</B> String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY",
+ * "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
+ * </OL>
+ *
+ */
+public class TableTypeBean extends DatabaseNamedObjectBean implements TableType {
+ private static final long serialVersionUID = -5095835769360603900L;
+ private String tableTypeName;
+
+ /**
+ * Default constructor
+ */
+ public TableTypeBean() {
+ }
+
+ /**
+ * Is table type represents TABLE
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents TABLE
+ */
+ public Boolean isTable( String tableTypeName ) {
+ return DEF_TABLE_TYPE_TABLE.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents TABLE
+ *
+ * @return true if current table type represents TABLE
+ */
+ public Boolean isTable() {
+ return isTable(getName());
+ }
+
+ /**
+ * Is table type represents VIEW
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents VIEW
+ */
+ public Boolean isView( String tableTypeName ) {
+ return DEF_TABLE_TYPE_VIEW.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents VIEW
+ *
+ * @return true if current table type represents VIEW
+ */
+ public Boolean isView() {
+ return isView(getName());
+ }
+
+ /**
+ * Is table type represents SYSTEM TABLE
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents SYSTEM TABLE
+ */
+ public Boolean isSystemTable( String tableTypeName ) {
+ return DEF_TABLE_TYPE_SYS_TABLE.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents SYSTEM TABLE
+ *
+ * @return true if current table type represents SYSTEM TABLE
+ */
+ public Boolean isSystemTable() {
+ return isSystemTable(getName());
+ }
+
+ /**
+ * Is current table type represents GLOBAL TEMPORARY
+ *
+ * @param tableTypeName the table type string
+ * @return true if current table type represents GLOBAL TEMPORARY
+ */
+ public Boolean isGlobalTemporary( String tableTypeName ) {
+ return DEF_TABLE_TYPE_GLOBAL_TEMP.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents GLOBAL TEMPORARY
+ *
+ * @return true if table type represents GLOBAL TEMPORARY
+ */
+ public Boolean isGlobalTemporary() {
+ return isGlobalTemporary(getName());
+ }
+
+ /**
+ * Is table type represents LOCAL TEMPORARY
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents LOCAL TEMPORARY
+ */
+ public Boolean islocalTemporary( String tableTypeName ) {
+ return DEF_TABLE_TYPE_LOCAL_TEMP.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents LOCAL TEMPORARY
+ *
+ * @return true if current table type represents LOCAL TEMPORARY
+ */
+ public Boolean isLocalTemporary() {
+ return islocalTemporary(getName());
+ }
+
+ /**
+ * Is table type represents ALIAS
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents ALIAS
+ */
+ public Boolean isAlias( String tableTypeName ) {
+ return DEF_TABLE_TYPE_ALIAS.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents ALIAS
+ *
+ * @return true if current table type represents ALIAS
+ */
+ public Boolean isAlias() {
+ return isAlias(getName());
+ }
+
+ /**
+ * Is table type represents SYNONYM
+ *
+ * @param tableTypeName the table type string
+ * @return true if table type represents SYNONYM
+ */
+ public Boolean isSynonym( String tableTypeName ) {
+ return DEF_TABLE_TYPE_SYNONYM.equals(tableTypeName);
+ }
+
+ /**
+ * Is current table type represents SYNONYM
+ * @return true if current table type represents SYNONYM
+ */
+ public Boolean isSynonym() {
+ return isSynonym(getName());
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBean.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBean.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBean.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,177 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.api.Attribute;
+import org.jboss.dna.common.jdbc.model.api.UserDefinedType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+
+/**
+ * Provides User Defined Type (UDT) specific metadata. Retrieves a description of the user-defined types (UDTs) defined in a
+ * particular schema. Schema-specific UDTs may have type JAVA_OBJECT, STRUCT, or DISTINCT.
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ * @since 1.2 (JDBC 2.0)
+ */
+public class UserDefinedTypeBean extends SchemaObjectBean implements UserDefinedType {
+ private static final long serialVersionUID = -7493272131759308580L;
+ private Set<Attribute> columns = new HashSet<Attribute>();
+ private String className;
+ private SqlType sqlType;
+ private SqlType baseType;
+ private UserDefinedType superType;
+
+ /**
+ * Default constructor
+ */
+ public UserDefinedTypeBean() {
+ }
+
+ /**
+ * Returns JAVA class name for UDT
+ *
+ * @return JAVA class name for UDT
+ */
+ public String getClassName() {
+ return className;
+ }
+
+ /**
+ * Sets JAVA class name for UDT
+ *
+ * @param className JAVA class name for UDT
+ */
+ public void setClassName( String className ) {
+ this.className = className;
+ }
+
+ /**
+ * Gets SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ *
+ * @return SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ */
+ public SqlType getSqlType() {
+ return sqlType;
+ }
+
+ /**
+ * Sets SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ *
+ * @param sqlType the SQL type from java.sql.Types. One of JAVA_OBJECT, STRUCT, or DISTINCT
+ */
+ public void setSqlType( SqlType sqlType ) {
+ this.sqlType = sqlType;
+ }
+
+ /**
+ * Gets SQL base type from java.sql.Types. Type code of the source type of a DISTINCT type or the type that implements the
+ * user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (null if
+ * DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)
+ *
+ * @return SQL base type from java.sql.Types.
+ */
+ public SqlType getBaseType() {
+ return baseType;
+ }
+
+ /**
+ * Sets SQL base type from java.sql.Types. Type code of the source type of a DISTINCT type or the type that implements the
+ * user-generated reference type of the SELF_REFERENCING_COLUMN of a structured type as defined in java.sql.Types (null if
+ * DATA_TYPE is not DISTINCT or not STRUCT with REFERENCE_GENERATION = USER_DEFINED)
+ *
+ * @param baseType the SQL base type from java.sql.Types.
+ */
+ public void setBaseType( SqlType baseType ) {
+ this.baseType = baseType;
+ }
+
+ /**
+ * Gets a set of UDT attributes
+ *
+ * @return a set of UDT attributes
+ */
+ public Set<Attribute> getAttributes() {
+ return columns;
+ }
+
+ /**
+ * adds Attribute
+ *
+ * @param attribute the Attribute
+ */
+ public void addAttribute( Attribute attribute ) {
+ columns.add(attribute);
+ }
+
+ /**
+ * deletes Attribute
+ *
+ * @param attribute the Attribute
+ */
+ public void deleteAttribute( Attribute attribute ) {
+ columns.remove(attribute);
+ }
+
+ /**
+ * Returns UDT attribute for specified attribute name or null
+ *
+ * @param attributeName the name of attribute
+ * @return UDT attribute for specified attribute name or null.
+ */
+ public Attribute findAttributeByName( String attributeName ) {
+ for (Attribute a : columns) {
+ if (a.getName().equals(attributeName)) {
+ return a;
+ }
+ }
+ // return nothing
+ return null;
+ }
+
+ // ===============================================================
+ // ------------------- JDBC 3.0 ---------------------------------
+ // ===============================================================
+
+ /**
+ * Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database. Only
+ * the immediate super type/ sub type relationship is modeled.
+ *
+ * @return super type for this UDT if any
+ * @since 1.4 (JDBC 3.0)
+ */
+ public UserDefinedType getSuperType() {
+ return superType;
+ }
+
+ /**
+ * Sets a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database. Only the
+ * immediate super type/ sub type relationship is modeled.
+ *
+ * @param superType the super type for this UDT if any
+ * @since 1.4 (JDBC 3.0)
+ */
+ public void setSuperType( UserDefinedType superType ) {
+ this.superType = superType;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import javax.sql.DataSource;
+
+/**
+ * DataSource based Database Metadata Provider (such as JEE App container based)
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface DataSourceDatabaseMetadataProvider extends DatabaseMetadataProvider {
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Returns DataSource
+ *
+ * @return DataSource
+ * @throws Exception
+ */
+ DataSource getDataSource() throws Exception;
+
+ /**
+ * Gets data source JNDI name
+ *
+ * @return data source JNDI name
+ */
+ String getDataSourceName();
+
+ /**
+ * Sets data source JNDI name
+ *
+ * @param dataSourceName the data source JNDI name
+ */
+ void setDataSourceName( String dataSourceName );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.util.Properties;
+
+/**
+ * Database Meta data provider
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface DatabaseMetadataProvider extends Serializable {
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Releases database resources
+ *
+ * @param silently if true never generates Exception; otherwise mage rethrow RunTimeException
+ */
+ void release( boolean silently );
+
+ /**
+ * Returns database metadata
+ *
+ * @return database metadata
+ * @throws Exception
+ */
+ DatabaseMetaData getDatabaseMetaData() throws Exception;
+
+ /**
+ * Returns database connection
+ *
+ * @return database connection
+ * @throws Exception
+ */
+ Connection getConnection() throws Exception;
+
+ /**
+ * Returns DatabaseMetadataProvider logical name
+ *
+ * @return the DatabaseMetadataProvider logical name
+ */
+ String getName();
+
+ /**
+ * Sets the DatabaseMetadataProvider logical name
+ *
+ * @param name the DatabaseMetadataProvider logical name
+ */
+ void setName( String name );
+
+ /**
+ * Get provider's notation for empty string
+ *
+ * @return provider's notation for empty string
+ */
+ String getEmptyStringNotation();
+
+ /**
+ * Set provider's notation for empty string
+ *
+ * @param emptyStringNotation the provider's notation for empty string
+ */
+ void setEmptyStringNotation( String emptyStringNotation );
+
+ /**
+ * Get provider's notation for NULL string
+ *
+ * @return provider's notation for NULL string
+ */
+ String getNullStringNotation();
+
+ /**
+ * Set provider's notation for NULL string
+ *
+ * @param nullStringNotation the provider's notation for NULL string
+ */
+ void setNullStringNotation( String nullStringNotation );
+
+ /**
+ * Returns provider properties
+ *
+ * @return provider properties
+ */
+ Properties getProperties();
+
+ /**
+ * Sets the provider properties
+ *
+ * @param properties the provider properties
+ */
+ void setProperties( Properties properties );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDataSourceDatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDataSourceDatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDataSourceDatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import java.sql.Connection;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+/**
+ * Default DataSource based DatabaseMetadataProvider
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DefaultDataSourceDatabaseMetadataProvider extends DefaultDatabaseMetadataProvider
+ implements DataSourceDatabaseMetadataProvider {
+ // ~ Instance fields ------------------------------------------------------------------
+
+ private static final long serialVersionUID = -405855619877872933L;
+ private String dataSourceName;
+ private DataSource dataSource;
+
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Default Constructor
+ */
+ public DefaultDataSourceDatabaseMetadataProvider() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name the DatabaseMetadataProvider logical name
+ */
+ public DefaultDataSourceDatabaseMetadataProvider( String name ) {
+ super(name);
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Opens new database connection based on suppied parameters
+ *
+ * @return new database connection based on suppied parameters
+ * @throws Exception
+ */
+ @Override
+ protected Connection openConnection() throws Exception {
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug("Opening database connection from data source " + getDataSourceName());
+ }
+
+ // loads connection from data source
+ return getDataSource().getConnection();
+ }
+
+ /**
+ * Returns DataSource
+ *
+ * @return DataSource
+ * @throws Exception
+ */
+ public DataSource getDataSource() throws Exception {
+ // lazy load data source
+ if (dataSource == null) {
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug("Creating JNDI initial context with following properties: " + getProperties());
+ }
+
+ // create initial context using properties if any
+ InitialContext initialContext = new InitialContext(getProperties());
+
+ try {
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug("Performing JNDI lookup for data source " + getDataSourceName());
+ }
+
+ // lookups datasource
+ dataSource = (DataSource)initialContext.lookup(getDataSourceName());
+ } finally {
+ // close context
+ initialContext.close();
+ }
+ }
+
+ // return
+ return dataSource;
+ }
+
+ /**
+ * Sets data source JNDI name
+ *
+ * @return data source JNDI name
+ */
+ public String getDataSourceName() {
+ // return
+ return dataSourceName;
+ }
+
+ /**
+ * Sets data source JNDI name
+ *
+ * @param dataSourceName the data source JNDI name
+ */
+ public void setDataSourceName( String dataSourceName ) {
+ this.dataSourceName = dataSourceName;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,234 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.common.jdbc.JdbcMetadataI18n;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.util.Properties;
+
+/**
+ * Default DatabaseMetadataProvider
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public abstract class DefaultDatabaseMetadataProvider implements DatabaseMetadataProvider {
+ // ~ Instance fields ------------------------------------------------------------------
+ private static final long serialVersionUID = -4164910060171439260L;
+ private String name;
+ private Properties properties;
+ private String emptyStringNotation;
+ private String nullStringNotation;
+
+ /**
+ * Logging for this instance
+ */
+ protected Logger log = Logger.getLogger(getClass());
+
+ /**
+ * Database metadata
+ */
+ protected DatabaseMetaData databaseMetaData;
+
+ /**
+ * Datbase connection
+ */
+ protected Connection connection;
+
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Default Constructor
+ */
+ public DefaultDatabaseMetadataProvider() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name the DatabaseMetadataProvider logical name
+ */
+ public DefaultDatabaseMetadataProvider( String name ) {
+ this();
+ setName(name);
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Opens new database connection based on supplied parameters
+ *
+ * @return new database connection based on supplied parameters
+ * @throws Exception
+ */
+ protected abstract Connection openConnection() throws Exception;
+
+ /**
+ * Releases database resources
+ *
+ * @param silently if true never generates Exception; otherwise mage rethrow RunTimeException
+ */
+ public void release( boolean silently ) {
+ // releases databaseMetaData
+ if (databaseMetaData != null) {
+ databaseMetaData = null;
+ }
+
+ // releases connection
+ if (connection != null) {
+ try {
+ // close connection
+ connection.close();
+
+ log.debug (JdbcMetadataI18n.databaseConnectionHasBeenReleased.text(getName()));
+ } catch (Exception ex) {
+ log.error(JdbcMetadataI18n.errorClosingDatabaseConnection, ex);
+
+ if (!silently) {
+ throw new RuntimeException(
+ JdbcMetadataI18n.errorClosingDatabaseConnection.text(getName()), ex);
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns database metadata
+ *
+ * @return database metadata
+ * @throws Exception
+ */
+ public DatabaseMetaData getDatabaseMetaData() throws Exception {
+ // lazy load of database metadata
+ if (databaseMetaData == null) {
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Getting Database metadata for a provider %1$s", getName()));
+ }
+
+ // obtains metadata from connection
+ databaseMetaData = getConnection().getMetaData();
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug(String.format("Database metadata received for a provider %1$s", getName()));
+ }
+ }
+
+ // return
+ return databaseMetaData;
+ }
+
+ /**
+ * Returns database connection
+ *
+ * @return database connection
+ * @throws Exception
+ */
+ public Connection getConnection() throws Exception {
+ // lazy open of connection
+ if (connection == null) {
+ // opens new connectection
+ connection = openConnection();
+
+ // log debug info
+ log.info(JdbcMetadataI18n.databaseConnectionHasBeenEstablished, getName());
+ }
+
+ // return
+ return connection;
+ }
+
+ /**
+ * Returns DatabaseMetadataProvider logical name
+ *
+ * @return the DatabaseMetadataProvider logical name
+ */
+ public String getName() {
+ // return
+ return name;
+ }
+
+ /**
+ * Sets the DatabaseMetadataProvider logical name
+ *
+ * @param name the DatabaseMetadataProvider logical name
+ */
+ public void setName( String name ) {
+ this.name = name;
+ }
+
+ /**
+ * Get provider's notation for empty string
+ *
+ * @return provider's notation for empty string
+ */
+ public String getEmptyStringNotation() {
+ return emptyStringNotation;
+ }
+
+ /**
+ * Set provider's notation for empty string
+ *
+ * @param emptyStringNotation the provider's notation for empty string
+ */
+ public void setEmptyStringNotation( String emptyStringNotation ) {
+ this.emptyStringNotation = emptyStringNotation;
+ }
+
+ /**
+ * Get provider's notation for NULL string
+ *
+ * @return provider's notation for NULL string
+ */
+ public String getNullStringNotation() {
+ return nullStringNotation;
+ }
+
+ /**
+ * Set provider's notation for NULL string
+ *
+ * @param nullStringNotation the provider's notation for NULL string
+ */
+ public void setNullStringNotation( String nullStringNotation ) {
+ this.nullStringNotation = nullStringNotation;
+ }
+
+ /**
+ * Returns provider properties
+ *
+ * @return provider properties
+ */
+ public Properties getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the provider properties
+ *
+ * @param properties the provider properties
+ */
+ public void setProperties( Properties properties ) {
+ this.properties = properties;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDriverDatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDriverDatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DefaultDriverDatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,161 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+/**
+ * Default DatabaseMetadataProvider based on driver
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DefaultDriverDatabaseMetadataProvider extends DefaultDatabaseMetadataProvider
+ implements DriverDatabaseMetadataProvider {
+ // ~ Instance fields ------------------------------------------------------------------
+
+ private static final long serialVersionUID = -3616979905696406464L;
+ private String driverClassName;
+ private String databaseUrl;
+ private String userName;
+ private String password;
+
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Default constructor
+ */
+ public DefaultDriverDatabaseMetadataProvider() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name the DatabaseMetadataProvider logical name
+ */
+ public DefaultDriverDatabaseMetadataProvider( String name ) {
+ super(name);
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Opens new database connection based on suppied parameters
+ *
+ * @return new database connection based on suppied parameters
+ * @throws Exception
+ */
+ protected Connection openConnection() throws Exception {
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug("Loading JDBC driver class: " + getDriverClassName());
+ }
+
+ // trying to load database driver by name
+ Class.forName(getDriverClassName());
+
+ // log debug info
+ if (log.isDebugEnabled()) {
+ log.debug("Opening database connection by using driver manager. The URL: " + getDatabaseUrl() + ". The user: "
+ + getUserName());
+ }
+
+ // opening connection by using Driver manager
+ return DriverManager.getConnection(getDatabaseUrl(), getUserName(), getPassword());
+ }
+
+ /**
+ * Gets JDBC driver class name
+ *
+ * @return the JDBC driver class name
+ */
+ public String getDriverClassName() {
+ // return
+ return driverClassName;
+ }
+
+ /**
+ * Sets JDBC driver class name
+ *
+ * @param driverClassName the JDBC driver class name
+ */
+ public void setDriverClassName( String driverClassName ) {
+ this.driverClassName = driverClassName;
+ }
+
+ /**
+ * Gets database URL as string
+ *
+ * @return database URL as string
+ */
+ public String getDatabaseUrl() {
+ // return
+ return databaseUrl;
+ }
+
+ /**
+ * Sets the database URL as string
+ *
+ * @param databaseUrl the database URL as string
+ */
+ public void setDatabaseUrl( String databaseUrl ) {
+ this.databaseUrl = databaseUrl;
+ }
+
+ /**
+ * Gets the user name
+ *
+ * @return the user name
+ */
+ public String getUserName() {
+ // return
+ return userName;
+ }
+
+ /**
+ * Sets the user name
+ *
+ * @param userName the user name
+ */
+ public void setUserName( String userName ) {
+ this.userName = userName;
+ }
+
+ /**
+ * Get user's password
+ *
+ * @return user's password
+ */
+ public String getPassword() {
+ // return
+ return password;
+ }
+
+ /**
+ * Sets the user's password
+ *
+ * @param password the user's password
+ */
+ public void setPassword( String password ) {
+ this.password = password;
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProvider.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProvider.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProvider.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+/**
+ * DatabaseMetadataProvider based on simple driver/connection
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface DriverDatabaseMetadataProvider extends DatabaseMetadataProvider {
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Gets JDBC driver class name
+ *
+ * @return the JDBC driver class name
+ */
+ String getDriverClassName();
+
+ /**
+ * Sets JDBC driver class name
+ *
+ * @param driverClassName the JDBC driver class name
+ */
+ void setDriverClassName( String driverClassName );
+
+ /**
+ * Gets database URL as string
+ *
+ * @return database URL as string
+ */
+ String getDatabaseUrl();
+
+ /**
+ * Sets the database URL as string
+ *
+ * @param databaseUrl the database URL as string
+ */
+ void setDatabaseUrl( String databaseUrl );
+
+ /**
+ * Gets the user name
+ *
+ * @return the user name
+ */
+ String getUserName();
+
+ /**
+ * Sets the user name
+ *
+ * @param userName the user name
+ */
+ void setUserName( String userName );
+
+ /**
+ * Get user's password
+ *
+ * @return user's password
+ */
+ String getPassword();
+
+ /**
+ * Sets the user's password
+ *
+ * @param password the user's password
+ */
+ void setPassword( String password );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/util/DatabaseUtil.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/util/DatabaseUtil.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/common/jdbc/util/DatabaseUtil.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,3441 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.util;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Types;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.commons.beanutils.PropertyUtils;
+import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.common.jdbc.JdbcMetadataI18n;
+import org.jboss.dna.common.jdbc.model.api.*;
+import org.jboss.dna.common.jdbc.model.ModelFactory;
+
+/**
+ * Database related utilities
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseUtil {
+ /**
+ * Logging for this instance
+ */
+ private static Logger log = Logger.getLogger(DatabaseUtil.class);
+
+ /**
+ * Standard UDT types as string
+ */
+ private static String standardUserDefinedTypes = "JAVA_OBJECT,STRUCT,DISTINCT";
+
+ private static Map standardUserDefinedTypesMapping = new HashMap();
+
+ static {
+ standardUserDefinedTypesMapping.put("JAVA_OBJECT", new Integer(SqlType.JAVA_OBJECT.getType()));
+ standardUserDefinedTypesMapping.put("STRUCT", new Integer(SqlType.STRUCT.getType()));
+ standardUserDefinedTypesMapping.put("DISTINCT", new Integer(SqlType.DISTINCT.getType()));
+ }
+
+ // ~ Constructors ---------------------------------------------------------------------
+
+ /**
+ * Constructor
+ */
+ private DatabaseUtil() {
+ }
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /**
+ * Returns Standard UDT types as string
+ *
+ * @return Standard UDT types as string
+ */
+ public static String getStandardUserDefinedTypes() {
+ return standardUserDefinedTypes;
+ }
+
+ /**
+ * Converts string array of UDT names to appropriate int array of UDT types specified in java.sql.Types
+ *
+ * @param userDefinedTypes the string array of UDT names
+ * @return int array of user defined types specified in java.sql.Types
+ */
+ public static int[] getUserDefinedTypes( String userDefinedTypes ) {
+ // convert comma separated list of user defined types to array
+ String[] userDefinedTypesStringArray = (userDefinedTypes == null) ? null : userDefinedTypes.split(",");
+ // create UDT int array
+ int[] userDefinedTypesArray = new int[userDefinedTypesStringArray.length];
+ // fill array
+ for (int i = 0; i < userDefinedTypesStringArray.length; i++) {
+ // get value from map
+ Integer udtType = (Integer)standardUserDefinedTypesMapping.get(userDefinedTypesStringArray[i]);
+ // set int value
+ userDefinedTypesArray[i] = (udtType == null) ? Types.NULL : udtType.intValue();
+ }
+ return userDefinedTypesArray;
+ }
+
+ /**
+ * Returns boolean with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @return boolean with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Boolean getBoolean( ResultSet resultSet,
+ String columnName ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get boolean
+ boolean value = resultSet.getBoolean(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : (value == true) ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ /**
+ * Returns boolean with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @param failOnError if true raises exception
+ * @return boolean with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Boolean getBoolean( ResultSet resultSet,
+ String columnName,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get boolean
+ boolean value = false;
+ try {
+ value = resultSet.getBoolean(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : (value == true) ? Boolean.TRUE : Boolean.FALSE;
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnName, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns boolean with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @return boolean with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Boolean getBoolean( ResultSet resultSet,
+ int columnIndex ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get boolean
+ boolean value = resultSet.getBoolean(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : (value == true) ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ /**
+ * Returns boolean with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @param failOnError if true raises exception
+ * @return boolean with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Boolean getBoolean( ResultSet resultSet,
+ int columnIndex,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get boolean
+ boolean value = false;
+ try {
+ value = resultSet.getBoolean(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : (value == true) ? Boolean.TRUE : Boolean.FALSE;
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnIndex, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns integer with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @return integer with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Integer getInteger( ResultSet resultSet,
+ String columnName ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ int value = resultSet.getInt(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Integer(value);
+ }
+
+ /**
+ * Returns integer with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @param failOnError if true raises exception
+ * @return integer with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Integer getInteger( ResultSet resultSet,
+ String columnName,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ int value = 0;
+ try {
+ value = resultSet.getInt(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Integer(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnName, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns integer with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @return integer with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Integer getInteger( ResultSet resultSet,
+ int columnIndex ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ int value = resultSet.getInt(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Integer(value);
+ }
+
+ /**
+ * Returns integer with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @param failOnError if true raises exception
+ * @return integer with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Integer getInteger( ResultSet resultSet,
+ int columnIndex,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ int value = 0;
+ try {
+ value = resultSet.getInt(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Integer(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnIndex, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns long with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @return long with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Long getLong( ResultSet resultSet,
+ String columnName ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ long value = resultSet.getLong(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Long(value);
+ }
+
+ /**
+ * Returns long with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @param failOnError if true raises exception
+ * @return long with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Long getLong( ResultSet resultSet,
+ String columnName,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ long value = 0;
+ try {
+ value = resultSet.getLong(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Long(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnName, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns long with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @return long with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Long getLong( ResultSet resultSet,
+ int columnIndex ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ long value = resultSet.getLong(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Long(value);
+ }
+
+ /**
+ * Returns long with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @param failOnError if true raises exception
+ * @return long with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Long getLong( ResultSet resultSet,
+ int columnIndex,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ long value = 0;
+ try {
+ value = resultSet.getLong(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Long(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnIndex, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns double with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Double getDouble( ResultSet resultSet,
+ String columnName ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ double value = resultSet.getDouble(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Double(value);
+ }
+
+ /**
+ * Returns double with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @param failOnError if true raises exception
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Double getDouble( ResultSet resultSet,
+ String columnName,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ double value = 0.0;
+ try {
+ value = resultSet.getLong(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : new Double(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnName, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns double with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Double getDouble( ResultSet resultSet,
+ int columnIndex ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ double value = resultSet.getDouble(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Double(value);
+ }
+
+ /**
+ * Returns double with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @param failOnError if true raises exception
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static Double getDouble( ResultSet resultSet,
+ int columnIndex,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ double value = 0.0;
+ try {
+ value = resultSet.getLong(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : new Double(value);
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnIndex, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns String with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static String getString( ResultSet resultSet,
+ String columnName ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ String value = resultSet.getString(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : value;
+ }
+
+ /**
+ * Returns String with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnName the name of column
+ * @param failOnError if true raises exception
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static String getString( ResultSet resultSet,
+ String columnName,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get
+ String value = null;
+ try {
+ value = resultSet.getString(columnName);
+ // return
+ return (resultSet.wasNull()) ? null : value;
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnName, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns String with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static String getString( ResultSet resultSet,
+ int columnIndex ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ // get integer
+ String value = resultSet.getString(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : value;
+ }
+
+ /**
+ * Returns String with respect to NULL values (ResultSet.wasNull())
+ *
+ * @param resultSet the result set to fetch from
+ * @param columnIndex the index of column
+ * @param failOnError if true raises exception
+ * @return double with respect to NULL values (could be null)
+ * @throws SQLException
+ */
+ public static String getString( ResultSet resultSet,
+ int columnIndex,
+ boolean failOnError ) throws SQLException {
+ // check result set
+ if (resultSet == null) {
+ return null;
+ }
+ String value = null;
+ try {
+ value = resultSet.getString(columnIndex);
+ // return
+ return (resultSet.wasNull()) ? null : value;
+
+ } catch (SQLException e) {
+ if (failOnError) {
+ throw e;
+ } else {
+ log.error(JdbcMetadataI18n.unableToGetValueFromColumn, columnIndex, e.getMessage());
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns BestRowIdentifierScopeType or null
+ *
+ * @param type the best row identifier
+ * @return BestRowIdentifierScopeType or null
+ */
+ public static BestRowIdentifierScopeType getBestRowIdentifierScopeType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (BestRowIdentifierScopeType sType : BestRowIdentifierScopeType.values()) {
+ if (sType.getScope() == type.intValue()) {
+ return sType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown best row identifier scope type %d", "getBestRowIdentifierScopeType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns ColumnPseudoType or null
+ *
+ * @param type the column pseudo type
+ * @return ColumnPseudoType or null
+ */
+ public static ColumnPseudoType getColumnPseudoType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (ColumnPseudoType pType : ColumnPseudoType.values()) {
+ if (pType.getType() == type.intValue()) {
+ return pType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown column pseudo type %d", "getColumnPseudoType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns IndexType or null
+ *
+ * @param type the index type
+ * @return IndexType or null
+ */
+ public static IndexType getIndexType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (IndexType iType : IndexType.values()) {
+ if (iType.getType() == type.intValue()) {
+ return iType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown index type %d", "getKeyDeferrabilityType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns KeyDeferrabilityType or null
+ *
+ * @param type the key defferability type
+ * @return KeyDeferrabilityType or null
+ */
+ public static KeyDeferrabilityType getKeyDeferrabilityType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (KeyDeferrabilityType dType : KeyDeferrabilityType.values()) {
+ if (dType.getDeferrability() == type.intValue()) {
+ return dType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown key deferrability type %d", "getKeyDeferrabilityType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns KeyModifyRuleType or null
+ *
+ * @param type the key modify rule type
+ * @return KeyModifyRuleType or null
+ */
+ public static KeyModifyRuleType getKeyModifyRuleType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (KeyModifyRuleType rType : KeyModifyRuleType.values()) {
+ if (rType.getRule() == type.intValue()) {
+ return rType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown key modify rule type %d", "getKeyModifyRuleType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns column nullability, or null
+ *
+ * @param type
+ * @return NullabilityType
+ */
+ public static NullabilityType getNullabilityType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (NullabilityType nType : NullabilityType.values()) {
+ if (nType.getNullability() == type.intValue()) {
+ return nType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown nullability type %d", "getNullabilityType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns ParameterIoType based on type, or null
+ *
+ * @param type i/o type
+ * @return ParameterIoType based on type, or null
+ */
+ public static ParameterIoType getParameterIoType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (ParameterIoType ioType : ParameterIoType.values()) {
+ if (ioType.getType() == type.intValue()) {
+ return ioType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown parameter I/O type %d", "getParameterIoType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns PrivilegeType or null
+ *
+ * @param type the privilege type
+ * @return PrivilegeType or null
+ */
+ public static PrivilegeType getPrivilegeType( String type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (PrivilegeType pType : PrivilegeType.values()) {
+ if (pType.getType().equals(type)) {
+ return pType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown privilege type %s", "getPrivilegeType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns ResultSetConcurrencyType or null
+ *
+ * @param type the concurrency
+ * @return ResultSetConcurrencyType or null
+ */
+ public static ResultSetConcurrencyType getResultSetConcurrencyType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (ResultSetConcurrencyType cType : ResultSetConcurrencyType.values()) {
+ if (cType.getConcurrency() == type.intValue()) {
+ return cType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown result set concurrency type %d", "getResultSetConcurrencyType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns ResultSetHoldabilityType or null
+ *
+ * @param type the holdability
+ * @return ResultSetHoldabilityType or null
+ */
+ public static ResultSetHoldabilityType getResultSetHoldabilityType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (ResultSetHoldabilityType hType : ResultSetHoldabilityType.values()) {
+ if (hType.getHoldability() == type.intValue()) {
+ return hType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown result set holdability type %d", "getResultSetHoldabilityType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns ResultSetType or null
+ *
+ * @param type the result set type
+ * @return ResultSetType or null
+ */
+ public static ResultSetType getResultSetType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (ResultSetType rsType : ResultSetType.values()) {
+ if (rsType.getType() == type.intValue()) {
+ return rsType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown result set type %d", "getResultSetType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns SearchabilityType or null
+ *
+ * @param type the searchability
+ * @return SearchabilityType or null
+ */
+ public static SearchabilityType getSearchabilityType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (SearchabilityType sType : SearchabilityType.values()) {
+ if (sType.getSearchability() == type.intValue()) {
+ return sType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown serachability type %d", "getSearchabilityType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns SortSequenceType or null
+ *
+ * @param type the sort sequence
+ * @return SortSequenceType or null
+ */
+ public static SortSequenceType getSortSequenceType( String type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for values
+ for (SortSequenceType sType : SortSequenceType.values()) {
+ if ((sType.getType() != null) && (sType.getType().equals(type))) {
+ return sType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown sort sequence type %s", "getSortSequenceType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns SqlStateType based on type, or null
+ *
+ * @param type the SQL state type
+ * @return SqlStateType based on type, or null
+ */
+ public static SQLStateType getSqlStateType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for Type values
+ for (SQLStateType stateType : SQLStateType.values()) {
+ if (stateType.getState() == type.intValue()) {
+ return stateType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown SQL state type %d", "getSqlStateType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns SqlType based on data type, or null
+ * @param type the SQL type
+ * @return SqlType based on data type, or null
+ */
+ public static SqlType getSqlType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for SqlType values
+ for (SqlType sqlType : SqlType.values()) {
+ if (sqlType.getType() == type.intValue()) {
+ return sqlType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown SQL Type %d", "getSqlType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns SP result type based on PROCEDURE_TYPE
+ *
+ * @param type the stored procedure result type
+ * @return SP result type based on PROCEDURE_TYPE, or null
+ */
+ public static StoredProcedureResultType getStoredProcedureResultType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for SqlType values
+ for (StoredProcedureResultType spResultType : StoredProcedureResultType.values()) {
+ if (spResultType.getType() == type.intValue()) {
+ return spResultType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown stored procedure result type %d", "getStoredProcedureResultType", type));
+
+ return null;
+ }
+
+ /**
+ * Returns transaction isolation level, or null
+ *
+ * @param type the level type
+ * @return transaction isolation level, or null
+ */
+ public static TransactionIsolationLevelType getTransactionIsolationLevelType( Integer type ) {
+ // check input
+ if (type == null) {
+ return null;
+ }
+ // check for Type values
+ for (TransactionIsolationLevelType txType : TransactionIsolationLevelType.values()) {
+ if (txType.getLevel() == type.intValue()) {
+ return txType;
+ }
+ }
+ // log only if not found
+ log.debug(String.format("[%s] Unknown transaction isolation level type %d", "getTransactionIsolationLevelType", type));
+
+ return null;
+ }
+
+ /**
+ * Creates catalog based on current record in result set; adds catalog to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created catalog
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Catalog populateCatalog( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get type catalog
+ String catalogName = getString(resultSet, "TABLE_CAT", false);
+
+ // create catalog object
+ Catalog catalog = factory.createCatalog();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ catalog.setName(catalogName);
+ // set remarks
+ // catalog.setRemarks (remarks); // N/A
+ // TODO set extra properties
+ // catalog.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Catalog ***
+ // ***************
+
+ // add catalog to the list
+ database.addCatalog(catalog);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The catalog '%s' has been added.", database.getName(), catalogName));
+ }
+
+ return catalog;
+ }
+
+ /**
+ * Creates schema based on current record in result set; adds schema to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created schema
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Schema populateSchema( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get schema name
+ String schemaName = getString(resultSet, "TABLE_SCHEM", false);
+
+ // get catalog name
+ String catalogName = getString(resultSet, "TABLE_CATALOG", false);
+
+ // create schema object
+ Schema schema = factory.createSchema();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ schema.setName(schemaName);
+ // set remarks
+ // schema.setRemarks (remarks); // N/A
+ // TODO set extra properties
+ // schema.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Schema ***
+ // ***************
+
+ // check catalog name
+ if (catalogName != null) {
+ Catalog catalog = database.findCatalogByName(catalogName);
+ schema.setCatalog(catalog);
+ }
+
+ // add schema to the list
+ database.addSchema(schema);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The schema '%s' has been added.", database.getName(), schemaName));
+ }
+
+ return schema;
+ }
+
+ /**
+ * Creates table types based on current record in result set; adds table types to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created schema
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+
+ public static TableType populateTableType( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get table type
+ String tableTypeName = getString(resultSet, "TABLE_TYPE", false);
+
+ // create table type object
+ TableType tableType = factory.createTableType();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ tableType.setName(tableTypeName);
+ // set remarks
+ // schema.setRemarks (remarks); // N/A
+ // TODO set extra properties
+ // schema.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Table Type ***
+ // ***************
+
+ // add table type to the list
+ database.addTableType(tableType);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table type '%s' has been added.", database.getName(), tableType));
+ }
+
+ return tableType;
+ }
+
+ /**
+ * Creates stored procedure based on current record in result set; adds SP to the database
+ *
+ * @param factory the model factory to create SP
+ * @param resultSet the stored procedure result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created SP
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static StoredProcedure populateStoredProcedure( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get procedure catalog
+ String procedureCatalog = getString(resultSet, "PROCEDURE_CAT", false);
+ // get procedure schema
+ String procedureSchema = getString(resultSet, "PROCEDURE_SCHEM", false);
+ // get procedure name
+ String procedureName = getString(resultSet, "PROCEDURE_NAME", false);
+ // get remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+ // get kind of procedure
+ Integer procedureType = getInteger(resultSet, "PROCEDURE_TYPE", false);
+
+ // create Stored Procedure object
+ StoredProcedure sp = factory.createStoredProcedure();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ sp.setName(procedureName);
+ // set remarks
+ sp.setRemarks(remarks);
+ // TODO set extra properties
+ // sp.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog
+ if ((procedureCatalog != null) && (procedureCatalog.trim().length() != 0)) {
+ // find catalog
+ Catalog catalog = database.findCatalogByName(procedureCatalog);
+ // set catalog
+ sp.setCatalog(catalog);
+ // warn if null
+ if (catalog == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the procedure %s (schema %s, catalog %s)",
+ database.getName(),
+ procedureName,
+ procedureSchema,
+ procedureCatalog));
+ }
+ // if fail is enabled
+ if (failOnError && (catalog == null)) {
+ throw new DatabaseMetaDataMethodException("Catalog name shall be provided", "populateStoredProcedure");
+ }
+ }
+
+ // set schema
+ if ((procedureSchema != null) && (procedureSchema.trim().length() != 0)) {
+ // find schema
+ Schema schema = database.findSchemaByName(procedureCatalog, procedureSchema);
+ // set schema
+ sp.setSchema(schema);
+ // warn if null
+ if (schema == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the procedure %s (schema %s, catalog %s)",
+ database.getName(),
+ procedureName,
+ procedureSchema,
+ procedureCatalog));
+ }
+ // if fail is enabled
+ if (failOnError && (schema == null)) {
+ throw new DatabaseMetaDataMethodException("Schema name shall be provided", "populateStoredProcedure");
+ }
+ }
+
+ // ***********************
+ // *** StoredProcedure ***
+ // ***********************
+
+ // set sp result type
+ sp.setResultType(getStoredProcedureResultType(procedureType));
+
+ // add SP to the list
+ database.addStoredProcedure(sp);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The Stored procedure '%s' (schema %s, catalog %s) has been added.",
+ database.getName(),
+ procedureName,
+ procedureSchema,
+ procedureCatalog));
+ }
+
+ return sp;
+ }
+
+ /**
+ * Creates stored procedure parameter based on current record in result set; adds SP parameter to the SP
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param storedProcedure the owner stored procedure
+ * @param ordinalPosition the parameter ordinal position
+ * @return created SP parameter
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Parameter populateStoredProcedureParameter( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ StoredProcedure storedProcedure,
+ int ordinalPosition ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (storedProcedure == null) {
+ throw new IllegalArgumentException("storedProcedure");
+ }
+ // get procedure catalog
+ String procedureCatalog = (storedProcedure.getCatalog() == null) ? null : storedProcedure.getCatalog().getName();
+ // get procedure schema
+ String procedureSchema = (storedProcedure.getSchema() == null) ? null : storedProcedure.getSchema().getName();
+ // get procedure name
+ String procedureName = storedProcedure.getName();
+
+ // parameter name
+ String parameterName = getString(resultSet, "COLUMN_NAME", false);
+ // parameter i/o type
+ Integer parameterType = getInteger(resultSet, "COLUMN_TYPE", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // precision
+ Integer precision = getInteger(resultSet, "PRECISION", false);
+ // length
+ Integer length = getInteger(resultSet, "LENGTH", false);
+ // scale
+ Integer scale = getInteger(resultSet, "SCALE", false);
+ // radix
+ Integer radix = getInteger(resultSet, "RADIX", false);
+ // nullable
+ Integer nullableType = getInteger(resultSet, "NULLABLE", false);
+ // remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+
+ // create Stored Procedure Parameter object
+ Parameter parameter = factory.createParameter();
+
+ // ***************************************
+ // *** DatabaseNamedObject properties ***
+ // ***************************************
+
+ // name
+ parameter.setName(parameterName);
+ // remarks
+ parameter.setRemarks(remarks);
+ // TODO set extra properties
+ // parameter.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Column ***
+ // ***************
+
+ // owner
+ parameter.setOwner(storedProcedure);
+ // nullability
+ parameter.setNullabilityType(getNullabilityType(nullableType));
+ // SQL type
+ parameter.setSqlType(getSqlType(dataType));
+ // type name
+ parameter.setTypeName(typeName);
+ // Size
+ parameter.setSize(length);
+ // precision
+ parameter.setPrecision(precision);
+ // Radix
+ parameter.setRadix(radix);
+ // DefaultValue
+ parameter.setDefaultValue(null); // not defined among standard columns
+ // OrdinalPosition
+ parameter.setOrdinalPosition(ordinalPosition);
+ // CharOctetLength
+ parameter.setCharOctetLength(null); // N/A
+ // addPrivilege
+ // parameter.addPrivilege (privilege); // N/A
+
+ // *****************
+ // *** Parameter ***
+ // *****************
+
+ // i/o type
+ parameter.setIoType(getParameterIoType(parameterType));
+ // scale
+ parameter.setScale(scale);
+
+ // add parameter to the SP
+ storedProcedure.addParameter(parameter);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The Stored procedure '%s' (schema %s, catalog %s) parameter %s has been added.",
+ database.getName(),
+ procedureName,
+ procedureSchema,
+ procedureCatalog,
+ parameterName));
+ }
+
+ return parameter;
+ }
+
+ /**
+ * Creates table based on current record in result set; adds table to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created table
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Table populateTable( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get catalog
+ String tableCatalog = getString(resultSet, "TABLE_CAT", false);
+
+ // get schema
+ String tableSchema = getString(resultSet, "TABLE_SCHEM", false);
+
+ // get name
+ String tableName = getString(resultSet, "TABLE_NAME", false);
+ // get type
+ String tableTypeName = getString(resultSet, "TABLE_TYPE", false);
+ // get remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+ // get type catalog
+ String typeCatalogName = getString(resultSet, "TYPE_CAT", false);
+
+ // get type schema
+ String typeSchemaName = getString(resultSet, "TYPE_SCHEM", false);
+ // get type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // get self reeferencing column name
+ String selfRefColumnName = getString(resultSet, "SELF_REFERENCING_COL_NAME", false);
+ // get ref generation
+ String refGeneration = getString(resultSet, "REF_GENERATION", false);
+
+ // create Table object
+ Table table = factory.createTable();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ table.setName(tableName);
+ // set remarks
+ table.setRemarks(remarks);
+ // TODO set extra properties
+ // table.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog
+ if ((tableCatalog != null) && (tableCatalog.trim().length() != 0)) {
+ // find catalog
+ Catalog catalog = database.findCatalogByName(tableCatalog);
+ // set catalog
+ table.setCatalog(catalog);
+ // warn if null
+ if (catalog == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ tableSchema,
+ tableCatalog));
+ }
+ // if fail is enabled
+ if (failOnError) {
+ throw new DatabaseMetaDataMethodException("Catalog name shall be provided", "populateTable");
+
+ }
+ }
+
+ // set schema
+ if ((tableSchema != null) && (tableSchema.trim().length() != 0)) {
+ // find schema
+ Schema schema = database.findSchemaByName(tableCatalog, tableSchema);
+ // set schema
+ table.setSchema(schema);
+ // warn if null
+ if (schema == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ tableSchema,
+ tableCatalog));
+ }
+ // if fail is enabled
+ if (failOnError) {
+ throw new DatabaseMetaDataMethodException("Table name shall be provided", "populateTable");
+ }
+ }
+
+ // **************
+ // *** Table ***
+ // **************
+
+ // set table type
+ if (tableTypeName != null) {
+ // create
+ TableType tableType = factory.createTableType();
+ // fill
+ tableType.setName(tableTypeName);
+ // set type
+ table.setTableType(tableType);
+ }
+
+ // set catalog
+ if ((typeCatalogName != null) && (typeCatalogName.trim().length() != 0)) {
+ // find catalog
+ Catalog typeCatalog = database.findCatalogByName(typeCatalogName);
+ // set type catalog
+ table.setTypeCatalog(typeCatalog);
+ // warn if null
+ if (typeCatalog == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ tableSchema,
+ typeCatalogName));
+ }
+ }
+
+ // set schema
+ if ((typeSchemaName != null) && (typeSchemaName.trim().length() != 0)) {
+ // find schema
+ Schema typeSchema = database.findSchemaByName(typeCatalogName, typeSchemaName);
+ // set schema
+ table.setTypeSchema(typeSchema);
+ // warn if null
+ if (typeSchema == null) {
+ traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ typeSchemaName,
+ typeCatalogName));
+ }
+ // if fail is enabled
+ if (failOnError && (typeSchema == null)) {
+ throw new DatabaseMetaDataMethodException("Schema name shall be provided", "populateTable");
+ }
+ }
+
+ // set type name
+ table.setTypeName(typeName);
+ // set self referencing column name
+ table.setSelfReferencingColumnName(selfRefColumnName);
+ // set reference generation
+ table.setReferenceGeneration(refGeneration);
+
+ // add table to the list
+ database.addTable(table);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) has been added.",
+ database.getName(),
+ tableName,
+ tableSchema,
+ tableCatalog));
+ }
+
+ return table;
+ }
+
+ /**
+ * Creates table column based on current record in result set; adds column to the table
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created table column
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static TableColumn populateTableColumn( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // column name
+ String columnName = getString(resultSet, "COLUMN_NAME", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // size
+ Integer size = getInteger(resultSet, "COLUMN_SIZE", false);
+ // precision
+ Integer precision = getInteger(resultSet, "DECIMAL_DIGITS", false);
+ // radix
+ Integer radix = getInteger(resultSet, "NUM_PREC_RADIX", false);
+ // nullable
+ Integer nullableType = getInteger(resultSet, "NULLABLE", false);
+ // remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+ // default value
+ String defaultValue = getString(resultSet, "COLUMN_DEF", false);
+ // character Octet Length
+ Integer charOctetLength = getInteger(resultSet, "CHAR_OCTET_LENGTH", false);
+ // ordinal position
+ Integer ordinalPosition = getInteger(resultSet, "ORDINAL_POSITION", false);
+ // is nullable string
+ String isNullableString = getString(resultSet, "IS_NULLABLE", false);
+ // scope catalog
+ String scopeCatalog = getString(resultSet, "SCOPE_CATLOG", false);
+ // scope schema
+ String scopeSchema = getString(resultSet, "SCOPE_SCHEMA", false);
+ // scope table
+ String scopeTable = getString(resultSet, "SCOPE_TABLE", false);
+ // sourceDataType
+ Integer sourceDataType = getInteger(resultSet, "SOURCE_DATA_TYPE", false);
+
+ // create table column object
+ TableColumn column = factory.createTableColumn();
+
+ // ***************************************
+ // *** DatabaseNamedObject properties ***
+ // ***************************************
+
+ // name
+ column.setName(columnName);
+ // remarks
+ column.setRemarks(remarks);
+ // TODO set extra properties
+ // column.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Column ***
+ // ***************
+
+ // owner
+ column.setOwner(table);
+ // nullability. The isNullableString is not used so far
+ column.setNullabilityType(getNullabilityType(nullableType));
+ // SQL type
+ column.setSqlType(getSqlType(dataType));
+ // type name
+ column.setTypeName(typeName);
+ // Size
+ column.setSize(size);
+ // precision
+ column.setPrecision(precision);
+ // Radix
+ column.setRadix(radix);
+ // DefaultValue
+ column.setDefaultValue(defaultValue);
+ // OrdinalPosition
+ column.setOrdinalPosition(ordinalPosition);
+ // CharOctetLength
+ column.setCharOctetLength(charOctetLength);
+ // addPrivilege
+ // column.addPrivilege (privilege); //
+
+ // ********************
+ // *** Table Column ***
+ // ********************
+
+ // pseudo type
+ column.setPseudoType(ColumnPseudoType.NOT_PSEUDO);
+
+ // set reference
+ if ((scopeCatalog != null) || (scopeSchema != null) || (scopeTable != null) || (sourceDataType != null)) {
+ // create reference
+ Reference reference = factory.createReference();
+ // set Source Data Type
+ reference.setSourceDataType(getSqlType(sourceDataType));
+ // find table and set as source
+ reference.setSourceTable(database.findTableByName(scopeCatalog, scopeSchema, scopeTable));
+
+ // set reference
+ column.setReference(reference);
+ }
+
+ // add column to the table
+ table.addColumn(column);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) column %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ columnName));
+ }
+
+ return column;
+ }
+
+ /**
+ * Creates table best row identifier based on current record in result set; adds best row identifier to the table
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created table best row identifier
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static BestRowIdentifier populateBestRowIdentifier( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // scope type
+ Integer scope = getInteger(resultSet, "SCOPE", false);
+ // column name
+ String columnName = getString(resultSet, "COLUMN_NAME", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // precision
+ Integer precision = getInteger(resultSet, "COLUMN_SIZE", false);
+ // scale
+ Integer scale = getInteger(resultSet, "DECIMAL_DIGITS", false);
+ // pseudoColumn
+ Integer pseudoColumn = getInteger(resultSet, "PSEUDO_COLUMN", false);
+
+ // *************************************
+ // *** BestRowIdentifier properties ***
+ // *************************************
+
+ // get scope type
+ BestRowIdentifierScopeType scopeType = getBestRowIdentifierScopeType(scope);
+
+ // check not null
+ if (scopeType == null) {
+ // if exception generation is enabled then raise exception - invalid scope
+ if (failOnError == true) {
+ throw new IllegalArgumentException("scopeType");
+ } else {
+ return null;
+ }
+ }
+
+ // find table best row identifier object
+ BestRowIdentifier brId = table.findBestRowIdentifierByScopeType(scopeType);
+ // check if null
+ if (brId == null) {
+ // create
+ brId = factory.createBestRowIdentifier();
+ }
+
+ // set scope type
+ brId.setScopeType(scopeType);
+
+ // determine if current record shows pseudo column
+ boolean isPseudoColumn = ((getColumnPseudoType(pseudoColumn) != null) && (getColumnPseudoType(pseudoColumn) == ColumnPseudoType.PSEUDO));
+
+ TableColumn column = null;
+
+ if (isPseudoColumn) {
+ // create
+ column = factory.createTableColumn();
+
+ // ***************************************
+ // *** DatabaseNamedObject properties ***
+ // ***************************************
+
+ // name
+ column.setName(columnName);
+ // remarks
+ // column.setRemarks (remarks); // N/A
+ // TODO set extra properties
+ // column.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Column ***
+ // ***************
+
+ // owner
+ column.setOwner(table);
+ // SQL type
+ column.setSqlType(getSqlType(dataType));
+ // type name
+ column.setTypeName(typeName);
+ // precision
+ column.setPrecision(precision);
+ // size
+ column.setSize(precision);
+ // scale
+ column.setRadix(scale);
+ // pseudo type
+ column.setPseudoType(getColumnPseudoType(pseudoColumn));
+ // add to the table
+ table.addColumn(column);
+ } else {
+ // trying to find column
+ column = table.findColumnByName(columnName);
+
+ // if column exists
+ if (column != null) {
+ // pseudo type
+ column.setPseudoType(getColumnPseudoType(pseudoColumn));
+ }
+ }
+
+ // if column exists
+ if (column != null) {
+ // add to the best row identifier
+ brId.addColumn(column);
+ }
+
+ // add best row identifier to the table
+ table.addBestRowIdentifier(brId);
+
+ // get scope type string
+ String scopeName = (brId.getScopeType() == null) ? null : brId.getScopeType().getName();
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) best row identifier with scope %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ scopeName));
+ }
+
+ return brId;
+ }
+
+ /**
+ * Creates table's primary key based on ALL records in result set; adds pk columns to the table's primary key
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created primary key
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static PrimaryKey populatePrimaryKey( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+ // pk name
+ String primaryKeyName = null; // initially null
+
+ // create table's primary key
+ PrimaryKey pk = factory.createPrimaryKey();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ // pk.setName (primaryKeyName); // it will be overriden later in this code
+ // set remarks
+ // pk.setRemarks (remarks); // N/A
+
+ // TODO set extra properties
+ // table.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog
+ pk.setCatalog(table.getCatalog());
+ // set schema
+ pk.setSchema(table.getSchema());
+
+ // process all columns included into primary key
+ while (resultSet.next()) {
+ // get PK name
+ if (primaryKeyName == null) {
+ primaryKeyName = getString(resultSet, "PK_NAME", false);
+ // set name
+ pk.setName(primaryKeyName);
+ }
+
+ // column name
+ String columnName = getString(resultSet, "COLUMN_NAME", false);
+ // sequence number within primary key
+ Integer ordinalPosition = getInteger(resultSet, "KEY_SEQ", false);
+
+ // trying to find table column with specified name
+ TableColumn tableColumn = table.findColumnByName(columnName);
+
+ String errMessage = null;
+ // warn if null
+ if (tableColumn == null) {
+ errMessage = String.format("[Database %s] Unable to find table column '%5$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ columnName);
+ traceLog.debug(errMessage);
+ }
+ // if fail is enabled
+ if (failOnError && (tableColumn == null)) {
+ throw new DatabaseMetaDataMethodException(errMessage, "populatePrimaryKey");
+ }
+
+ // create PK column
+ PrimaryKeyColumn pkColumn = factory.createPrimaryKeyColumn();
+ // check if we found the original table column
+ if (tableColumn != null) {
+ // mark original table column as part of PK
+ tableColumn.setPrimaryKeyColumn(Boolean.TRUE);
+ // clone properties from original table column to the pkcolumn
+ PropertyUtils.copyProperties(pkColumn, tableColumn);
+ } else { // recovery if table column is not found but we still want to create pk column
+ // set name at least
+ pkColumn.setName(columnName);
+ }
+ // modify ordinal position that correspond to the position in PK
+ pkColumn.setOrdinalPosition(ordinalPosition);
+
+ // add PK column to the primary key
+ pk.addColumn(pkColumn);
+ }
+
+ // set table primary key
+ table.setPrimaryKey(pk);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) primary key %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ primaryKeyName));
+ }
+
+ return pk;
+ }
+
+ /**
+ * Creates table's foreign keys based on ALL records in result set; adds fk columns to the table's foreing key
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created list of foreign keys
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Set<ForeignKey> populateForeignKeys( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // create table's foreign key
+ ForeignKey fk = factory.createForeignKey();
+
+ // process all columns included into foreign key
+ while (resultSet.next()) {
+ // primary key table catalog being imported
+ String pkTableCatalogName = getString(resultSet, "PKTABLE_CAT", false);
+ // primary key table schema being imported
+ String pkTableSchemaName = getString(resultSet, "PKTABLE_SCHEM", false);
+ // primary key table name being imported
+ String pkTableName = getString(resultSet, "PKTABLE_NAME", false);
+ // primary key column name being imported
+ String pkColumnName = getString(resultSet, "PKCOLUMN_NAME", false);
+
+ // FK table name, schema and catalog are already known, so it is useless to fetch
+
+ // foreign key column name
+ String fkColumnName = getString(resultSet, "FKCOLUMN_NAME", false);
+ // sequence number within foreign key
+ Integer ordinalPosition = getInteger(resultSet, "KEY_SEQ", false);
+ // update rule - What happens to a foreign key when the primary key is updated
+ Integer updateRule = getInteger(resultSet, "UPDATE_RULE", false);
+ // delete rule - What happens to the foreign key when primary is deleted
+ Integer deleteRule = getInteger(resultSet, "DELETE_RULE", false);
+ // foreign key name
+ String foreignKeyName = getString(resultSet, "FK_NAME", false);
+ // primary key name
+ String primaryKeyName = getString(resultSet, "PK_NAME", false);
+ // can the evaluation of foreign key constraints be deferred until commit
+ Integer defferability = getInteger(resultSet, "DEFERRABILITY", false);
+
+ //
+ // check if FK name has been set earlier and current record shows different FK -
+ // so we need to add FK (previous) to the table
+ //
+ if ((fk.getName() != null) && (!fk.getName().equals(foreignKeyName))) {
+ // add previous FK to the table
+ table.addForeignKey(fk);
+
+ // log
+ if (traceLog.isTraceEnabled()) {
+ traceLog.trace(String.format("[Database %s] The table '%s' (schema %s, catalog %s) foreign key %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ foreignKeyName));
+ }
+
+ // create new FK if a record is not last
+ fk = factory.createForeignKey();
+ } else {
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set FK name
+ fk.setName(foreignKeyName);
+ // set remarks
+ // fk.setRemarks (remarks); // N/A
+
+ // TODO set extra properties
+ // fk.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog
+ fk.setCatalog(table.getCatalog());
+ // set schema
+ fk.setSchema(table.getSchema());
+
+ // ***************************
+ // *** ForeignKey ***
+ // ***************************
+
+ // trying to find table column with specified name
+ TableColumn tableColumn = table.findColumnByName(fkColumnName);
+
+ String errMessage = null;
+ // warn if null
+ if (tableColumn == null) {
+ errMessage = String.format("[Database %s] Unable to find table column '%5$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ fkColumnName);
+ traceLog.debug(errMessage);
+ }
+ // if fail is enabled
+ if (failOnError && (tableColumn == null)) {
+ throw new DatabaseMetaDataMethodException(errMessage, "populateForeignKeys");
+ }
+
+ // create FK column
+ ForeignKeyColumn fkColumn = factory.createForeignKeyColumn();
+
+ // check if we found the original table column
+ if (tableColumn != null) {
+ // mark original table column as part of FK
+ tableColumn.setForeignKeyColumn(Boolean.TRUE);
+ // clone properties from original table column to the fkcolumn
+ PropertyUtils.copyProperties(fkColumn, tableColumn);
+ } else { // recovery if table column is not found but we still want to create fk column
+ // set name at least
+ fkColumn.setName(fkColumnName);
+ }
+ // modify ordinal position that correspond to the position in FK
+ fkColumn.setOrdinalPosition(ordinalPosition);
+
+ // check for PK table and corresponding PK column
+ Table pkTable = database.findTableByName(pkTableCatalogName, pkTableSchemaName, pkTableName);
+ // sets the scope table of a foreign key.
+ fk.setSourceTable(pkTable);
+ // find PK
+ PrimaryKey pk = (pkTable == null) ? null : pkTable.getPrimaryKey();
+ // set
+ fk.setSourcePrimaryKey(pk);
+
+ // What happens to a foreign key when the primary key is updated
+ fk.setUpdateRule(getKeyModifyRuleType(updateRule));
+ // What happens to a foreign key when the primary key is deleted
+ fk.setDeleteRule(getKeyModifyRuleType(deleteRule));
+ // Can the evaluation of foreign key constraints be deferred until commit
+ fk.setDeferrability(getKeyDeferrabilityType(defferability));
+
+ // find PK table column
+ TableColumn pkColumn = (pkTable == null) ? null : pkTable.findColumnByName(pkColumnName);
+ // Sets mapped source column (in PK/source table) for this foreign key column
+ fkColumn.setSourceColumn(pkColumn);
+
+ // add FK column to the foreign key
+ fk.addColumn(fkColumn);
+ }
+ }
+
+ // add FK to the table
+ table.addForeignKey(fk);
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) foreign key %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ fk.getName()));
+ }
+
+ // return set of created FK
+ return table.getForeignKeys();
+ }
+
+ /**
+ * Creates table's indexes based on ALL records in result set; adds columns to the table's index
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created list of index
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Set<Index> populateIndexes( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // create table's index
+ Index index = factory.createIndex();
+
+ // process all columns included into index
+ while (resultSet.next()) {
+ // table name, schema and catalog are already known, so it is useless to fetch
+
+ // Can index values be non-unique
+ Boolean nonUnique = getBoolean(resultSet, "NON_UNIQUE", false);
+ // index catalog
+ String indexQualifier = getString(resultSet, "INDEX_QUALIFIER", false);
+ // index name ; null when TYPE is tableIndexStatistic
+ String indexName = getString(resultSet, "INDEX_NAME", false);
+ // index type
+ Integer indexType = getInteger(resultSet, "TYPE", false);
+ // sequence number within index
+ Integer ordinalPosition = getInteger(resultSet, "ORDINAL_POSITION", false);
+ // index column name
+ String indexColumnName = getString(resultSet, "COLUMN_NAME", false);
+ // column sort sequence, "A" => ascending, "D" => descending, may be null if sort sequence is not supported;
+ // null when TYPE is tableIndexStatistic
+ String ascOrDesc = getString(resultSet, "ASC_OR_DESC", false);
+ // cardinality; When TYPE is tableIndexStatistic, then this is the number of rows in the table;
+ // otherwise, it is the number of unique values in the index.
+ Integer cardinality = getInteger(resultSet, "CARDINALITY", false);
+ // pages; When TYPE is tableIndexStatisic then this is the number of pages used for the table,
+ // otherwise it is the number of pages used for the current index.
+ Integer pages = getInteger(resultSet, "PAGES", false);
+ // filter condition if any (may be null)
+ String filterCondition = getString(resultSet, "FILTER_CONDITION", false);
+
+ //
+ // check if index name has been set earlier and current record shows different index -
+ // so we need to add index (previous) to the table
+ //
+ if ((index.getName() != null) && (!index.getName().equals(indexName))) {
+ // add previous FK to the table
+ table.addIndex(index);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) index %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ indexName));
+ }
+
+ // create new index if a record is not last
+ index = factory.createIndex();
+ } else {
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ index.setName(indexName);
+ // set remarks
+ // index.setRemarks (remarks); // N/A
+
+ // TODO set extra properties
+ // index.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog; index catalog me be defined by indexQualifier
+ index.setCatalog((indexQualifier == null) ? table.getCatalog() : database.findCatalogByName(indexQualifier));
+ // set schema
+ index.setSchema(table.getSchema());
+
+ // ***************************
+ // *** Index ***
+ // ***************************
+
+ // set unique as inversion of non unique
+ index.setUnique(nonUnique == null ? null : (nonUnique.booleanValue() == true) ? Boolean.FALSE : Boolean.TRUE);
+ // set Index Type
+ index.setIndexType(getIndexType(indexType));
+ // set Cardinality
+ index.setCardinality(cardinality);
+ // set Pages
+ index.setPages(pages);
+ // set filter condition
+ index.setFilterCondition(filterCondition);
+
+ // trying to find table column with specified name
+ TableColumn tableColumn = table.findColumnByName(indexColumnName);
+
+ String errMessage = null;
+ // warn if null
+ if (tableColumn == null) {
+ errMessage = String.format("[Database %s] Unable to find table column '%5$s' for the table %s (schema %s, catalog %s)",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ indexColumnName);
+ traceLog.debug(errMessage);
+ }
+ // if fail is enabled
+ if (failOnError && (tableColumn == null)) {
+ throw new DatabaseMetaDataMethodException(errMessage, "populateIndexes");
+
+ }
+
+ // create index column
+ IndexColumn indexColumn = factory.createIndexColumn();
+
+ // check if we found the original table column
+ if (tableColumn != null) {
+ // mark original table column as part of index
+ tableColumn.setIndexColumn(Boolean.TRUE);
+ // clone properties from original table column to the index column
+ PropertyUtils.copyProperties(indexColumn, tableColumn);
+ } else { // recovery if table column is not found but we still want to create index column
+ // set name at least
+ indexColumn.setName(indexColumnName);
+ }
+ // modify ordinal position that correspond to the position in index
+ indexColumn.setOrdinalPosition(ordinalPosition);
+ // sort sequence type
+ indexColumn.setSortSequenceType(getSortSequenceType(ascOrDesc));
+
+ // add index column to the index
+ index.addColumn(indexColumn);
+ }
+
+ }
+
+ // add index to the table
+ table.addIndex(index);
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) index %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ index.getName()));
+ }
+
+ // return set of created indexes
+ return table.getIndexes();
+ }
+
+ /**
+ * Creates table's version column (if pseudo) based on current record in result set; adds column to the table
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created/updated version table column
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static TableColumn populateVersionColumn( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // column name
+ String columnName = getString(resultSet, "COLUMN_NAME", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // size
+ Integer size = getInteger(resultSet, "COLUMN_SIZE", false);
+ // column length in bytes
+ Integer bufferLength = getInteger(resultSet, "BUFFER_LENGTH", false);
+ // precision
+ Integer precision = getInteger(resultSet, "DECIMAL_DIGITS", false);
+
+ // pseudo Column Type
+ Integer columnPseudoType = getInteger(resultSet, "PSEUDO_COLUMN", false);
+
+ // find table column object
+ TableColumn column = table.findColumnByName(columnName);
+
+ // create new
+ if (column == null) {
+ // creating column if not found (it is pseudo)
+ column = factory.createTableColumn();
+
+ // ***************************************
+ // *** DatabaseNamedObject properties ***
+ // ***************************************
+
+ // name
+ column.setName(columnName);
+
+ // ***************
+ // *** Column ***
+ // ***************
+
+ // owner
+ column.setOwner(table);
+ // SQL type
+ column.setSqlType(getSqlType(dataType));
+ // type name
+ column.setTypeName(typeName);
+ // Size
+ column.setSize(size);
+ // precision
+ column.setPrecision(precision);
+ // OrdinalPosition
+ column.setOrdinalPosition(null); // N/A
+
+ // ********************
+ // *** Table Column ***
+ // ********************
+
+ // add column to the table
+ table.addColumn(column);
+ }
+
+ // set pseudo type
+ column.setPseudoType(getColumnPseudoType(columnPseudoType));
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) column %s has been updated or added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ columnName));
+ }
+
+ return column;
+ }
+
+ /**
+ * Creates table's privileges based on ALL records in result set;
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @return created list of privileges
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Set<Privilege> populateTablePrivileges( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // process all privileges
+ while (resultSet.next()) {
+ // grantor of access (may be null)
+ String grantor = getString(resultSet, "GRANTOR", false);
+ // grantee of access
+ String grantee = getString(resultSet, "GRANTEE", false);
+ // name of access (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ String privilegeName = getString(resultSet, "PRIVILEGE", false);
+ // grantable string; "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
+ String isGrantableStr = getString(resultSet, "IS_GRANTABLE", false);
+
+ // create table's privilege
+ Privilege privilege = factory.createPrivilege();
+ // set name
+ privilege.setName(privilegeName);
+ // set PrivilegeType
+ privilege.setPrivilegeType(getPrivilegeType(privilegeName));
+ // set Grantor
+ privilege.setGrantor(grantor);
+ // set Grantee
+ privilege.setGrantee(grantee);
+ // set Grantable
+ privilege.setGrantable("YES".equals(isGrantableStr) == true ? Boolean.TRUE : ("NO".equals(isGrantableStr) == true ? Boolean.FALSE : null));
+
+ // add privilege
+ table.addPrivilege(privilege);
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) privilege %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ privilegeName));
+ }
+ }
+
+ // return
+ return table.getPrivileges();
+ }
+
+ /**
+ * Creates table's column privileges based on ALL records in result set;
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the owner table
+ * @param column the table column
+ * @return created list of privileges
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Set<Privilege> populateTableColumnPrivileges( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table,
+ TableColumn column ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+
+ // check for null
+ if (column == null) {
+ throw new IllegalArgumentException("column");
+ }
+
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // process all privileges
+ while (resultSet.next()) {
+ // grantor of access (may be null)
+ String grantor = getString(resultSet, "GRANTOR", false);
+ // grantee of access
+ String grantee = getString(resultSet, "GRANTEE", false);
+ // name of access (SELECT, INSERT, UPDATE, REFRENCES, ...)
+ String privilegeName = getString(resultSet, "PRIVILEGE", false);
+ // grantable string; "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
+ String isGrantableStr = getString(resultSet, "IS_GRANTABLE", false);
+
+ // create table's privilege
+ Privilege privilege = factory.createPrivilege();
+ // set name
+ privilege.setName(privilegeName);
+ // set PrivilegeType
+ privilege.setPrivilegeType(getPrivilegeType(privilegeName));
+ // set Grantor
+ privilege.setGrantor(grantor);
+ // set Grantee
+ privilege.setGrantee(grantee);
+ // set Grantable
+ privilege.setGrantable("YES".equals(isGrantableStr) == true ? Boolean.TRUE : ("NO".equals(isGrantableStr) == true ? Boolean.FALSE : null));
+
+ // add privilege
+ column.addPrivilege(privilege);
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) column %s privilege %s has been added.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ column.getName(),
+ privilegeName));
+ }
+ }
+
+ // return
+ return column.getPrivileges();
+ }
+
+ /**
+ * Creates SQL type info based on current record in result set; adds SQL type info to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created SQL type info
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static SqlTypeInfo populateSqlTypeInfo( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get type name
+ String typeName = getString(resultSet, "TYPE_NAME", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // precision
+ Long precision = getLong(resultSet, "PRECISION", false);
+ // literal prefix
+ String literalPrefix = getString(resultSet, "LITERAL_PREFIX", false);
+ // literal suffix
+ String literalSuffix = getString(resultSet, "LITERAL_SUFFIX", false);
+ // create params
+ String createParams = getString(resultSet, "CREATE_PARAMS", false);
+ // nullable
+ Integer nullableType = getInteger(resultSet, "NULLABLE", false);
+ // case sensitive
+ Boolean caseSensitive = getBoolean(resultSet, "CASE_SENSITIVE", false);
+ // searchable
+ Integer searchableType = getInteger(resultSet, "SEARCHABLE", false);
+ // is it unsigned
+ Boolean unsignedAttribute = getBoolean(resultSet, "UNSIGNED_ATTRIBUTE", false);
+ // is it fixed precision scale (can it be a money value)
+ Boolean fixedPrecisionScale = getBoolean(resultSet, "FIXED_PREC_SCALE", false);
+ // can it be used for an auto-increment value
+ Boolean autoIncrement = getBoolean(resultSet, "AUTO_INCREMENT", false);
+ // get local type name
+ String localTypeName = getString(resultSet, "LOCAL_TYPE_NAME", false);
+ // min scale supported
+ Integer minScale = getInteger(resultSet, "MINIMUM_SCALE", false);
+ // max scale supported
+ Integer maxScale = getInteger(resultSet, "MAXIMUM_SCALE", false);
+ // radix
+ Integer radix = getInteger(resultSet, "NUM_PREC_RADIX", false);
+
+ // create SQL type info object
+ SqlTypeInfo typeInfo = factory.createSqlTypeInfo();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ typeInfo.setName(typeName);
+ // set remarks
+ // typeInfo.setRemarks (remarks); // N/A
+ // TODO set extra properties
+ // typeInfo.addExtraProperty (String key, Object value);
+
+ // *******************
+ // *** SqlTypeInfo ***
+ // *******************
+
+ // Localized type name
+ typeInfo.setLocalizedTypeName(localTypeName);
+ // SQL type nullability
+ typeInfo.setNullabilityType(getNullabilityType(nullableType));
+ // SQL type from java.sql.Types
+ typeInfo.setSqlType(getSqlType(dataType));
+ // precision
+ typeInfo.setPrecision(precision);
+ // fixed precision scale
+ typeInfo.setFixedPrecisionScale(fixedPrecisionScale);
+ // number precision radix
+ typeInfo.setNumberPrecisionRadix(radix);
+ // minimum scale supported
+ typeInfo.setMinScale(minScale);
+ // maximum scale supported
+ typeInfo.setMaxScale(maxScale);
+ // literal prefix
+ typeInfo.setLiteralPrefix(literalPrefix);
+ // literal suffix
+ typeInfo.setLiteralSuffix(literalSuffix);
+ // parameters used in creating the type (may be null)
+ typeInfo.setCreateParams(createParams);
+ // Case Sensitive
+ typeInfo.setCaseSensitive(caseSensitive);
+ // searchability type
+ typeInfo.setSearchabilityType(getSearchabilityType(searchableType));
+ // Unsigned
+ typeInfo.setUnsigned(unsignedAttribute);
+ // Auto Increment
+ typeInfo.setAutoIncrement(autoIncrement);
+
+ // add SQL type info to the list
+ database.addSqlTypeInfo(typeInfo);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The SQL type '%s' has been added.", database.getName(), typeName));
+ }
+
+ return typeInfo;
+ }
+
+ /**
+ * Creates UDT based on current record in result set; adds UDT to the database
+ *
+ * @param factory the model factory to create table
+ * @param resultSet the table result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @return created UDT
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static UserDefinedType populateUDT( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // get type catalog
+ String udtCatalog = getString(resultSet, "TYPE_CAT", false);
+ // get type schema
+ String udtSchema = getString(resultSet, "TYPE_SCHEM", false);
+ // get type name
+ String udtName = getString(resultSet, "TYPE_NAME", false);
+ // get class name
+ String className = getString(resultSet, "CLASS_NAME", false);
+ // get data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // get remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+ // get base type
+ Integer baseType = getInteger(resultSet, "BASE_TYPE", false);
+
+ // create UDT object
+ UserDefinedType udt = factory.createUserDefinedType();
+
+ // ***************************
+ // *** DatabaseNamedObject ***
+ // ***************************
+
+ // set name
+ udt.setName(udtName);
+ // set remarks
+ udt.setRemarks(remarks);
+ // TODO set extra properties
+ // udt.addExtraProperty (String key, Object value);
+
+ // ********************
+ // *** SchemaObject ***
+ // ********************
+
+ // set catalog
+ if ((udtCatalog != null) && (udtCatalog.trim().length() != 0)) {
+ // find catalog
+ Catalog catalog = database.findCatalogByName(udtCatalog);
+ // set catalog
+ udt.setCatalog(catalog);
+
+ String errMessage = null;
+ // warn if null
+ if (catalog == null) {
+ errMessage = String.format("[Database %s] Unable to find catalog '%4$s' for the UDT %s (schema %s, catalog %s)",
+ database.getName(),
+ udtName,
+ udtSchema,
+ udtCatalog);
+ traceLog.debug(errMessage);
+ }
+ // if fail is enabled
+ if (failOnError) {
+ throw new DatabaseMetaDataMethodException(errMessage,"populateUDT");
+ }
+ }
+
+ // set schema
+ if ((udtSchema != null) && (udtSchema.trim().length() != 0)) {
+ // find schema
+ Schema schema = database.findSchemaByName(udtCatalog, udtSchema);
+ // set schema
+ udt.setSchema(schema);
+
+ String errMessage = null;
+ // warn if null
+ if (schema == null) {
+ errMessage = String.format("[Database %s] Unable to find schema '%3$s' for the UDT %s (schema %s, catalog %s)",
+ database.getName(),
+ udtName,
+ udtSchema,
+ udtCatalog);
+ traceLog.debug(errMessage);
+ }
+ // if fail is enabled
+ if (failOnError) {
+ throw new DatabaseMetaDataMethodException(errMessage, "populateUTD");
+
+ }
+ }
+
+ // **************
+ // *** UDT ***
+ // **************
+
+ // class name
+ udt.setClassName(className);
+ // SQL type
+ udt.setSqlType(getSqlType(dataType));
+ // base type
+ udt.setBaseType(getSqlType(baseType));
+
+ // add UDT to the list
+ database.addUserDefinedType(udt);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The UDT '%s' (schema %s, catalog %s) has been added.",
+ database.getName(),
+ udtName,
+ udtSchema,
+ udtCatalog));
+ }
+
+ return udt;
+ }
+
+ /**
+ * Creates UDT attribute based on current record in result set; adds attribute to the UDT
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param udt the owner UDT
+ * @return created UDT attribute
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static Attribute populateUDTAttribute( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ UserDefinedType udt ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (udt == null) {
+ throw new IllegalArgumentException("udt");
+ }
+ // get catalog name
+ String catalogName = (udt.getCatalog() == null) ? null : udt.getCatalog().getName();
+ // get schema name
+ String schemaName = (udt.getSchema() == null) ? null : udt.getSchema().getName();
+ // get UDT name
+ String udtName = udt.getName();
+
+ // column name
+ String columnName = getString(resultSet, "ATTR_NAME", false);
+ // data type
+ Integer dataType = getInteger(resultSet, "DATA_TYPE", false);
+ // type name
+ String typeName = getString(resultSet, "ATTR_TYPE_NAME", false);
+ // size
+ Integer size = getInteger(resultSet, "ATTR_SIZE", false);
+ // precision
+ Integer precision = getInteger(resultSet, "DECIMAL_DIGITS", false);
+ // radix
+ Integer radix = getInteger(resultSet, "NUM_PREC_RADIX", false);
+ // nullable
+ Integer nullableType = getInteger(resultSet, "NULLABLE", false);
+ // remarks
+ String remarks = getString(resultSet, "REMARKS", false);
+ // default value
+ String defaultValue = getString(resultSet, "ATTR_DEF", false);
+ // character Octet Length
+ Integer charOctetLength = getInteger(resultSet, "CHAR_OCTET_LENGTH", false);
+ // ordinal position
+ Integer ordinalPosition = getInteger(resultSet, "ORDINAL_POSITION", false);
+ // is nullable string
+ String isNullableString = getString(resultSet, "IS_NULLABLE", false);
+ // scope catalog
+ String scopeCatalog = getString(resultSet, "SCOPE_CATLOG", false);
+ // scope schema
+ String scopeSchema = getString(resultSet, "SCOPE_SCHEMA", false);
+ // scope table
+ String scopeTable = getString(resultSet, "SCOPE_TABLE", false);
+ // sourceDataType
+ Integer sourceDataType = getInteger(resultSet, "SOURCE_DATA_TYPE", false);
+
+ // create UDT attribute object
+ Attribute column = factory.createAttribute();
+
+ // ***************************************
+ // *** DatabaseNamedObject properties ***
+ // ***************************************
+
+ // name
+ column.setName(columnName);
+ // remarks
+ column.setRemarks(remarks);
+ // TODO set extra properties
+ // column.addExtraProperty (String key, Object value);
+
+ // ***************
+ // *** Column ***
+ // ***************
+
+ // owner
+ column.setOwner(udt);
+ // nullability. The isNullableString is not used so far
+ column.setNullabilityType(getNullabilityType(nullableType));
+ // SQL type
+ column.setSqlType(getSqlType(dataType));
+ // type name
+ column.setTypeName(typeName);
+ // Size
+ column.setSize(size);
+ // precision
+ column.setPrecision(precision);
+ // Radix
+ column.setRadix(radix);
+ // DefaultValue
+ column.setDefaultValue(defaultValue);
+ // OrdinalPosition
+ column.setOrdinalPosition(ordinalPosition);
+ // CharOctetLength
+ column.setCharOctetLength(charOctetLength);
+ // addPrivilege
+ // column.addPrivilege (privilege); //
+
+ // ********************
+ // *** Attribute ***
+ // ********************
+
+ // set reference
+ if ((scopeCatalog != null) || (scopeSchema != null) || (scopeTable != null) || (sourceDataType != null)) {
+ // create reference
+ Reference reference = factory.createReference();
+ // set Source Data Type
+ reference.setSourceDataType(getSqlType(sourceDataType));
+ // find table and set as source
+ reference.setSourceTable(database.findTableByName(scopeCatalog, scopeSchema, scopeTable));
+
+ // set reference
+ column.setReference(reference);
+ }
+
+ // add attribute to the UDT
+ udt.addAttribute(column);
+
+ // log
+ if (traceLog.isDebugEnabled()) {
+ traceLog.debug(String.format("[Database %s] The UDT '%s' (schema %s, catalog %s) attribute %s has been added.",
+ database.getName(),
+ udtName,
+ schemaName,
+ catalogName,
+ columnName));
+ }
+
+ return column;
+ }
+
+ /**
+ * Updates UDT super type info based on current record in result set
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param udt the UDT to update
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static void updateUDTSuperType( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ UserDefinedType udt ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (udt == null) {
+ throw new IllegalArgumentException("udt");
+ }
+ // get catalog name
+ String catalogName = (udt.getCatalog() == null) ? null : udt.getCatalog().getName();
+ // get schema name
+ String schemaName = (udt.getSchema() == null) ? null : udt.getSchema().getName();
+ // get UDT name
+ String udtName = udt.getName();
+
+ // super type catalog
+ String superTypeCatalog = getString(resultSet, "SUPERTYPE_CAT", false);
+ // super type schema
+ String superTypeSchema = getString(resultSet, "SUPERTYPE_SCHEM", false);
+ // super type
+ String superTypeName = getString(resultSet, "SUPERTYPE_NAME", false);
+
+ // ***********************
+ // *** UserDefinedType ***
+ // ***********************
+
+ // set super type if found in database
+ udt.setSuperType(database.findUserDefinedTypeByName(superTypeCatalog, superTypeSchema, superTypeName));
+
+ // log
+ if (udt.getSuperType() != null) {
+ traceLog.debug(String.format("[Database %s] The UDT '%s' (schema %s, catalog %s) has super type %s (schema %s, catalog %s).",
+ database.getName(),
+ udtName,
+ schemaName,
+ catalogName,
+ superTypeName,
+ superTypeSchema,
+ superTypeCatalog));
+ }
+ }
+
+ /**
+ * Updates table super table info based on current record in result set
+ *
+ * @param factory the model factory to create SP parameter
+ * @param resultSet the stored procedure parameter result set from DatabaseMetadata
+ * @param traceLog the log to write if any
+ * @param failOnError
+ * @param database the owner database
+ * @param table the table to update
+ * @throws Exception if any error occurs and failOnError is true then generates exception
+ */
+ public static void updateTableSuperTable( ModelFactory factory,
+ ResultSet resultSet,
+ Logger traceLog,
+ boolean failOnError,
+ Database database,
+ Table table ) throws Exception {
+ // check for null
+ if (factory == null) {
+ throw new IllegalArgumentException("factory");
+ }
+
+ // check for null
+ if (database == null) {
+ throw new IllegalArgumentException("database");
+ }
+
+ // check for null
+ if (resultSet == null) {
+ throw new IllegalArgumentException("resultSet");
+ }
+
+ // set trace log
+ if (traceLog == null) {
+ traceLog = log;
+ }
+
+ // check for null
+ if (table == null) {
+ throw new IllegalArgumentException("table");
+ }
+ // get catalog name
+ String catalogName = (table.getCatalog() == null) ? null : table.getCatalog().getName();
+ // get schema name
+ String schemaName = (table.getSchema() == null) ? null : table.getSchema().getName();
+ // get table name
+ String tableName = table.getName();
+
+ // super table name
+ String superTableName = getString(resultSet, "SUPERTABLE_NAME", false);
+
+ // *************
+ // *** Table ***
+ // *************
+
+ // set super table if found in database
+ table.setSuperTable(database.findTableByName(catalogName, schemaName, tableName));
+
+ // log
+ if (table.getSuperTable() != null) {
+ traceLog.debug(String.format("[Database %s] The table '%s' (schema %s, catalog %s) has super table %s.",
+ database.getName(),
+ tableName,
+ schemaName,
+ catalogName,
+ superTableName));
+ }
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/sequencers/JdbcSequencer.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/sequencers/JdbcSequencer.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/java/org/jboss/dna/graph/sequencers/JdbcSequencer.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.graph.sequencers;
+
+import java.sql.Connection;
+
+/**
+ * The interface for a DNA sequencer that processes a JDBC connection (for instance, JDBC Metadata) and stores in the repository.
+ * <p>
+ * Implementations must provide a no-argument constructor.
+ * </p>
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public interface JdbcSequencer {
+
+ /**
+ * Sequence the data found in the a JDBC connection (for instance, JDBC Metadata).
+ *
+ * @param connection the JDBC connection to be sequenced; never <code>null</code>
+ * @param output the output from the sequencing operation; never <code>null</code>
+ * @param context the context for the sequencing operation; never <code>null</code>
+ */
+ void sequence( Connection connection,
+ SequencerOutput output,
+ SequencerContext context );
+}
Added: trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/jdbc/JdbcMetadataI18n.properties
===================================================================
--- trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/jdbc/JdbcMetadataI18n.properties (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/main/resources/org/jboss/dna/common/jdbc/JdbcMetadataI18n.properties 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,25 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2008, Red Hat Middleware LLC, and individual contributors
+# as indicated by the @author tags. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+databaseConnectionHasBeenReleased=Database connection has been released for a provider {0}
+errorClosingDatabaseConnection=Error closing database connection for a provider {0}
+databaseConnectionHasBeenEstablished=Database connection has been established for a provider {0}
+unableToGetValueFromColumn=Unable to get value from a column with name {0}: {1}
\ No newline at end of file
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/ModelFactoryTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/ModelFactoryTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/ModelFactoryTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,227 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model;
+
+import junit.framework.TestCase;
+
+/**
+ * Model factory test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ModelFactoryTest extends TestCase {
+ // ~ Instance fields ------------------------------------------------------------------
+
+ private DefaultModelFactory modelFactory;
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /*
+ * @see TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // create
+ modelFactory = new DefaultModelFactory();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ // release
+ modelFactory = null;
+ super.tearDown();
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateAttribute() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Attribute", modelFactory.createAttribute());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateBestRowIdentifier() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create BestRowIdentifier", modelFactory.createBestRowIdentifier());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateCatalog() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Catalog", modelFactory.createCatalog());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateDatabase() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Database", modelFactory.createDatabase());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateForeignKey() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create ForeignKey", modelFactory.createForeignKey());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateForeignKeyColumn() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create ForeignKeyColumn", modelFactory.createForeignKeyColumn());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateIndex() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Index", modelFactory.createIndex());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateIndexColumn() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create IndexColumn", modelFactory.createIndexColumn());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateParameter() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Parameter", modelFactory.createParameter());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreatePrimaryKey() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create PrimaryKey", modelFactory.createPrimaryKey());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreatePrimaryKeyColumn() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create PrimaryKeyColumn", modelFactory.createPrimaryKeyColumn());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreatePrivilege() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Privilege", modelFactory.createPrivilege());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateReference() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Reference", modelFactory.createReference());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateSchema() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Schema", modelFactory.createSchema());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateSqlTypeConversionPair() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create SqlTypeConversionPair", modelFactory.createSqlTypeConversionPair());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateSqlTypeInfo() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create SqlTypeInfo", modelFactory.createSqlTypeInfo());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateStoredProcedure() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create StoredProcedure", modelFactory.createStoredProcedure());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateTable() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create Table", modelFactory.createTable());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateTableColumn() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create TableColumn", modelFactory.createTableColumn());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateTableType() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create TableType", modelFactory.createTableType());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testCreateUserDefinedType() {
+ // check that we're really create database model object
+ assertNotNull("Unable to create UserDefinedType", modelFactory.createUserDefinedType());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/AttributeBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/AttributeBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/AttributeBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.Attribute;
+import org.jboss.dna.common.jdbc.model.api.Reference;
+import junit.framework.TestCase;
+
+/**
+ * AttributeBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class AttributeBeanTest extends TestCase {
+
+ private Attribute bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new AttributeBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+ super.tearDown();
+ }
+
+ public void testSetReference() {
+ // create reference
+ Reference reference = new DefaultModelFactory().createReference();
+ // set
+ bean.setReference(reference);
+ // check
+ assertSame("Unable to set reference", reference, bean.getReference());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/BestRowIdentifierBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifierScopeType;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifier;
+import org.jboss.dna.common.jdbc.model.api.Column;
+import junit.framework.TestCase;
+
+/**
+ * BestRowIdentifierBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class BestRowIdentifierBeanTest extends TestCase {
+
+ BestRowIdentifier bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // create
+ bean = new BestRowIdentifierBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetScopeType() {
+ // set
+ bean.setScopeType(BestRowIdentifierScopeType.SESSION);
+ // check
+ assertSame("Unable to set scope type", BestRowIdentifierScopeType.SESSION, bean.getScopeType());
+ }
+
+ public void testGetColumns() {
+ // get
+ Set<Column> columnSet = bean.getColumns();
+ // check
+ assertNotNull("Unable to get columns", columnSet);
+ assertTrue("Column set should be empty by default", columnSet.isEmpty());
+ }
+
+ public void testAddColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ Column column = new DefaultModelFactory().createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testDeleteColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ Column column = new DefaultModelFactory().createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+
+ // delete
+ bean.deleteColumn(column);
+ // check
+ assertTrue("Column set should be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testFindColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ Column column = new DefaultModelFactory().createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CatalogBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CatalogBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CatalogBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.spi.CatalogBean;
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+
+/**
+ * CatalogBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class CatalogBeanTest extends TestCase {
+
+ private Catalog bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new CatalogBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testCatalogBean() {
+ // check
+ assertNotNull("Unable to create catalog bean", bean);
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,189 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.spi.ColumnBean;
+import org.jboss.dna.common.jdbc.model.api.Column;
+import org.jboss.dna.common.jdbc.model.api.Table;
+import org.jboss.dna.common.jdbc.model.api.NullabilityType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+
+/**
+ * ColumnBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ColumnBeanTest extends TestCase {
+
+ private Column bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new ColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetOwner() {
+ // create table
+ Table table = new DefaultModelFactory().createTable();
+ // set
+ bean.setOwner(table);
+ // check
+ assertSame("Unable to set owner", table, bean.getOwner());
+ }
+
+ public void testSetNullabilityType() {
+ // set
+ bean.setNullabilityType(NullabilityType.NULLABLE);
+ // check
+ assertSame("Unable to set nullability type", NullabilityType.NULLABLE, bean.getNullabilityType());
+ }
+
+ public void testSetSqlType() {
+ // set
+ bean.setSqlType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set SQL type", SqlType.VARCHAR, bean.getSqlType());
+ }
+
+ public void testSetTypeName() {
+ String TYPE_NAME = "My Type";
+ // set
+ bean.setTypeName(TYPE_NAME);
+ // check
+ assertEquals("Unable to set type name", TYPE_NAME, bean.getTypeName());
+ }
+
+ public void testSetSize() {
+ Integer size = new Integer(255);
+ // set
+ bean.setSize(size);
+ // check
+ assertSame("Unable to set size", size, bean.getSize());
+ }
+
+ public void testSetPrecision() {
+ Integer precision = new Integer(5);
+ // set
+ bean.setPrecision(precision);
+ // check
+ assertSame("Unable to set precision", precision, bean.getPrecision());
+ }
+
+ public void testSetRadix() {
+ Integer radix = new Integer(2);
+ // set
+ bean.setRadix(radix);
+ // check
+ assertSame("Unable to set radix", radix, bean.getRadix());
+ }
+
+ public void testSetDefaultValue() {
+ String defaultValue = "Hello";
+ // set
+ bean.setDefaultValue(defaultValue);
+ // check
+ assertEquals("Unable to set default value", defaultValue, bean.getDefaultValue());
+ }
+
+ public void testSetOrdinalPosition() {
+ Integer ordinalPosition = new Integer(1);
+ // set
+ bean.setOrdinalPosition(ordinalPosition);
+ // check
+ assertSame("Unable to set ordinalPosition", ordinalPosition, bean.getOrdinalPosition());
+ }
+
+ public void testSetCharOctetLength() {
+ Integer charOctetLength = new Integer(2);
+ // set
+ bean.setCharOctetLength(charOctetLength);
+ // check
+ assertSame("Unable to set char octet length", charOctetLength, bean.getCharOctetLength());
+ }
+
+ public void testGetPrivileges() {
+ Set<Privilege> privilegeSet = bean.getPrivileges();
+ // check
+ assertNotNull("Unable to get privileges", privilegeSet);
+ assertTrue("Privilege set should be empty by default", privilegeSet.isEmpty());
+ }
+
+ public void testAddPrivilege() {
+ String PRIVILEGE_NAME = "SELECT";
+ // create
+ Privilege privilege = new DefaultModelFactory().createPrivilege();
+ // set name
+ privilege.setName(PRIVILEGE_NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertFalse("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+ }
+
+ public void testDeletePrivilege() {
+ String PRIVILEGE_NAME = "SELECT";
+ // create
+ Privilege privilege = new DefaultModelFactory().createPrivilege();
+ // set name
+ privilege.setName(PRIVILEGE_NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertFalse("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+
+ // delete
+ bean.deletePrivilege(privilege);
+ // check
+ assertTrue("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+ }
+
+ public void testFindPriviledgeByName() {
+ String PRIVILEGE_NAME = "SELECT";
+ // create
+ Privilege privilege = new DefaultModelFactory().createPrivilege();
+ // set name
+ privilege.setName(PRIVILEGE_NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertSame("Unable to find privilege", privilege, bean.findPriviledgeByName(PRIVILEGE_NAME));
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/CoreMetaDataBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.CoreMetaData;
+import org.jboss.dna.common.jdbc.model.spi.CoreMetaDataBean;
+
+/**
+ * CoreMetaDataBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class CoreMetaDataBeanTest extends TestCase {
+
+ private CoreMetaData bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new CoreMetaDataBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testCoreMetaDataBean() {
+ assertNotNull("Unable to create CoreMetaData", bean);
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,2079 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import java.util.List;
+import org.jboss.dna.common.jdbc.model.api.*;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.ModelFactory;
+import org.jboss.dna.common.jdbc.model.api.DatabaseMetaDataMethodException;
+
+/**
+ * DatabaseBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseBeanTest extends TestCase {
+
+ private Database bean;
+ private ModelFactory factory;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new DatabaseBean();
+ factory = new DefaultModelFactory();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+ factory = null;
+ super.tearDown();
+ }
+
+ /**
+ * testDatabaseMetadataExceptions
+ */
+ public void testGetExceptions() {
+ // get list of exceptions
+ List<DatabaseMetaDataMethodException> exceptionList = bean.getExceptionList();
+
+ // check that the exception list in not null
+ assertNotNull("Database Metadata Method Exception List should not be null", exceptionList);
+
+ // check that exception list is empty
+ assertTrue("Database Metadata Method Exception List should be empty", exceptionList.isEmpty());
+
+ }
+
+ /**
+ * addDatabaseMetaDataMethodException
+ */
+ public void testAddException() {
+ String MESSAGE = "Database MetaData Method Exception";
+ String METHOD_NAME = "myMethod";
+
+ // create DatabaseMetaDataMethodException
+ DatabaseMetaDataMethodException exception = new DatabaseMetaDataMethodException(MESSAGE, METHOD_NAME, null);
+ // add Exception to error list
+ bean.addException(exception);
+
+ // get list of exceptions
+ List<DatabaseMetaDataMethodException> exceptionList = bean.getExceptionList();
+ // check that the exception added to the list
+ assertTrue("Unable to add DatabaseMetaDataMethodException to the error list for provider ",
+ exceptionList.contains(exception));
+ }
+
+ /**
+ * findDatabaseMetaDataMethodException
+ */
+ public void testFindException() {
+ String MESSAGE = "Database MetaData Method Exception";
+ String METHOD_NAME = "myMethod";
+
+ // create DatabaseMetaDataMethodException
+ DatabaseMetaDataMethodException exception = new DatabaseMetaDataMethodException(MESSAGE, METHOD_NAME, null);
+ // add Exception to error list
+ bean.addException(exception);
+
+ // check that the exception found
+ assertSame("Unable to find database metadata method exception", exception, bean.findException(METHOD_NAME));
+ }
+
+ /**
+ * isDatabaseMetaDataMethodFailed
+ */
+ public void testDatabaseMetaDataMethodFailed() {
+ String MESSAGE = "Database MetaData Method Exception";
+ String METHOD_NAME = "myMethod";
+
+ // create DatabaseMetaDataMethodException
+ DatabaseMetaDataMethodException exception = new DatabaseMetaDataMethodException(MESSAGE, METHOD_NAME, null);
+ // add Exception to error list
+ bean.addException(exception);
+
+ // check that the exception found
+ assertTrue("The database metadata method " + METHOD_NAME + " should be failed",
+ bean.isDatabaseMetaDataMethodFailed(METHOD_NAME));
+
+ }
+
+ public void testSetName() {
+ String VALUE = "My name";
+ // set
+ bean.setName(VALUE);
+ // check
+ assertSame(VALUE, bean.getName());
+ }
+
+ public void testSetAllProceduresAreCallable() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setAllProceduresAreCallable(VALUE);
+ // check
+ assertSame(VALUE, bean.isAllProceduresAreCallable());
+ }
+
+ public void testSetAllTablesAreSelectable() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setAllTablesAreSelectable(VALUE);
+ // check
+ assertSame(VALUE, bean.isAllTablesAreSelectable());
+ }
+
+ public void testSetURL() {
+ String VALUE = "My URL";
+ // set
+ bean.setURL(VALUE);
+ // check
+ assertSame(VALUE, bean.getURL());
+ }
+
+ public void testSetUserName() {
+ String VALUE = "My name";
+ // set
+ bean.setUserName(VALUE);
+ // check
+ assertSame(VALUE, bean.getUserName());
+ }
+
+ public void testSetReadOnly() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setReadOnly(VALUE);
+ // check
+ assertSame(VALUE, bean.isReadOnly());
+ }
+
+ public void testSetNullsAreSortedHigh() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setNullsAreSortedHigh(VALUE);
+ // check
+ assertSame(VALUE, bean.isNullsAreSortedHigh());
+ }
+
+ public void testSetNullsAreSortedLow() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setNullsAreSortedLow(VALUE);
+ // check
+ assertSame(VALUE, bean.isNullsAreSortedLow());
+ }
+
+ public void testSetNullsAreSortedAtStart() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setNullsAreSortedAtStart(VALUE);
+ // check
+ assertSame(VALUE, bean.isNullsAreSortedAtStart());
+ }
+
+ public void testSetNullsAreSortedAtEnd() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setNullsAreSortedAtEnd(VALUE);
+ // check
+ assertSame(VALUE, bean.isNullsAreSortedAtEnd());
+ }
+
+ public void testSetDatabaseProductName() {
+ String VALUE = "My product name";
+ // set
+ bean.setDatabaseProductName(VALUE);
+ // check
+ assertSame(VALUE, bean.getDatabaseProductName());
+ }
+
+ public void testSetDatabaseProductVersion() {
+ String VALUE = "My version";
+ // set
+ bean.setDatabaseProductVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDatabaseProductVersion());
+ }
+
+ public void testSetDriverName() {
+ String VALUE = "My driver name";
+ // set
+ bean.setDriverName(VALUE);
+ // check
+ assertSame(VALUE, bean.getDriverName());
+ }
+
+ public void testSetDriverVersion() {
+ String VALUE = "My driver version";
+ // set
+ bean.setDriverVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDriverVersion());
+ }
+
+ public void testSetDriverMajorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setDriverMajorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDriverMajorVersion());
+ }
+
+ public void testSetDriverMinorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setDriverMinorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDriverMinorVersion());
+ }
+
+ public void testSetUsesLocalFiles() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setUsesLocalFiles(VALUE);
+ // check
+ assertSame(VALUE, bean.isUsesLocalFiles());
+ }
+
+ public void testSetUsesLocalFilePerTable() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setUsesLocalFilePerTable(VALUE);
+ // check
+ assertSame(VALUE, bean.isUsesLocalFilePerTable());
+ }
+
+ public void testSetSupportsMixedCaseIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMixedCaseIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMixedCaseIdentifiers());
+ }
+
+ public void testSetStoresUpperCaseIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresUpperCaseIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresUpperCaseIdentifiers());
+ }
+
+ public void testSetStoresLowerCaseIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresLowerCaseIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresLowerCaseIdentifiers());
+ }
+
+ public void testSetStoresMixedCaseIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresMixedCaseIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresMixedCaseIdentifiers());
+ }
+
+ public void testSetSupportsMixedCaseQuotedIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMixedCaseQuotedIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMixedCaseQuotedIdentifiers());
+ }
+
+ public void testSetStoresUpperCaseQuotedIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresUpperCaseQuotedIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresUpperCaseQuotedIdentifiers());
+ }
+
+ public void testSetStoresLowerCaseQuotedIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresLowerCaseQuotedIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresLowerCaseQuotedIdentifiers());
+ }
+
+ public void testSetStoresMixedCaseQuotedIdentifiers() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setStoresMixedCaseQuotedIdentifiers(VALUE);
+ // check
+ assertSame(VALUE, bean.isStoresMixedCaseQuotedIdentifiers());
+ }
+
+ public void testSetIdentifierQuoteString() {
+ String VALUE = "My id";
+ // set
+ bean.setIdentifierQuoteString(VALUE);
+ // check
+ assertSame(VALUE, bean.getIdentifierQuoteString());
+ }
+
+ public void testGetSQLKeywords() {
+ Set<String> set = bean.getSQLKeywords();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSQLKeyword() {
+ String NAME = "My name";
+ // add
+ bean.addSQLKeyword(NAME);
+ // check
+ assertFalse(bean.getSQLKeywords().isEmpty());
+ }
+
+ public void testDeleteSQLKeyword() {
+ String NAME = "My name";
+ // add
+ bean.addSQLKeyword(NAME);
+ // check
+ assertFalse(bean.getSQLKeywords().isEmpty());
+
+ // delete
+ bean.deleteSQLKeyword(NAME);
+ // check
+ assertTrue(bean.getSQLKeywords().isEmpty());
+ }
+
+ public void testIsSQLKeywordSupported() {
+ String NAME = "My name";
+ // add
+ bean.addSQLKeyword(NAME);
+
+ // check
+ assertSame(Boolean.TRUE, bean.isSQLKeywordSupported(NAME));
+ }
+
+ public void testGetNumericFunctions() {
+ // get
+ Set<String> set = bean.getNumericFunctions();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddNumericFunction() {
+ String NAME = "My name";
+ // add
+ bean.addNumericFunction(NAME);
+ // check
+ assertFalse(bean.getNumericFunctions().isEmpty());
+ }
+
+ public void testDeleteNumericFunction() {
+ String NAME = "My name";
+ // add
+ bean.addNumericFunction(NAME);
+ // check
+ assertFalse(bean.getNumericFunctions().isEmpty());
+
+ // delete
+ bean.deleteNumericFunction(NAME);
+ // check
+ assertTrue(bean.getNumericFunctions().isEmpty());
+ }
+
+ public void testIsNumericFunctionSupported() {
+ String NAME = "My name";
+ // add
+ bean.addNumericFunction(NAME);
+
+ // check
+ assertSame(Boolean.TRUE, bean.isNumericFunctionSupported(NAME));
+ }
+
+ public void testGetStringFunctions() {
+ // get
+ Set<String> set = bean.getStringFunctions();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddStringFunction() {
+ String NAME = "My name";
+ // add
+ bean.addStringFunction(NAME);
+ // check
+ assertFalse(bean.getStringFunctions().isEmpty());
+ }
+
+ public void testDeleteStringFunction() {
+ String NAME = "My name";
+ // add
+ bean.addStringFunction(NAME);
+ // check
+ assertFalse(bean.getStringFunctions().isEmpty());
+
+ // delete
+ bean.deleteStringFunction(NAME);
+ // check
+ assertTrue(bean.getStringFunctions().isEmpty());
+ }
+
+ public void testIsStringFunctionSupported() {
+ String NAME = "My name";
+ // add
+ bean.addStringFunction(NAME);
+
+ // check
+ assertSame(Boolean.TRUE, bean.isStringFunctionSupported(NAME));
+ }
+
+ public void testGetSystemFunctions() {
+ // get
+ Set<String> set = bean.getSystemFunctions();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSystemFunction() {
+ String NAME = "My name";
+ // add
+ bean.addSystemFunction(NAME);
+ // check
+ assertFalse(bean.getSystemFunctions().isEmpty());
+ }
+
+ public void testDeleteSystemFunction() {
+ String NAME = "My name";
+ // add
+ bean.addSystemFunction(NAME);
+ // check
+ assertFalse(bean.getSystemFunctions().isEmpty());
+
+ // delete
+ bean.deleteSystemFunction(NAME);
+ // check
+ assertTrue(bean.getSystemFunctions().isEmpty());
+ }
+
+ public void testIsSystemFunctionSupported() {
+ String NAME = "My name";
+ // add
+ bean.addSystemFunction(NAME);
+
+ // check
+ assertSame(Boolean.TRUE, bean.isSystemFunctionSupported(NAME));
+ }
+
+ public void testGetTimeDateFunctions() {
+ // get
+ Set<String> set = bean.getTimeDateFunctions();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddTimeDateFunction() {
+ String NAME = "My name";
+ // add
+ bean.addTimeDateFunction(NAME);
+ // check
+ assertFalse(bean.getTimeDateFunctions().isEmpty());
+ }
+
+ public void testDeleteTimeDateFunction() {
+ String NAME = "My name";
+ // add
+ bean.addTimeDateFunction(NAME);
+ // check
+ assertFalse(bean.getTimeDateFunctions().isEmpty());
+
+ // delete
+ bean.deleteTimeDateFunction(NAME);
+ // check
+ assertTrue(bean.getTimeDateFunctions().isEmpty());
+ }
+
+ public void testIsTimeDateFunctionSupported() {
+ String NAME = "My name";
+ // add
+ bean.addTimeDateFunction(NAME);
+
+ // check
+ assertSame(Boolean.TRUE, bean.isTimeDateFunctionSupported(NAME));
+ }
+
+ public void testSetSearchStringEscape() {
+ String VALUE = "My search";
+ // set
+ bean.setSearchStringEscape(VALUE);
+ // check
+ assertSame(VALUE, bean.getSearchStringEscape());
+ }
+
+ public void testSetExtraNameCharacters() {
+ String VALUE = "My characters";
+ // set
+ bean.setExtraNameCharacters(VALUE);
+ // check
+ assertSame(VALUE, bean.getExtraNameCharacters());
+ }
+
+ public void testSetSupportsAlterTableWithAddColumn() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsAlterTableWithAddColumn(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsAlterTableWithAddColumn());
+ }
+
+ public void testSetSupportsAlterTableWithDropColumn() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsAlterTableWithDropColumn(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsAlterTableWithDropColumn());
+ }
+
+ public void testSetSupportsColumnAliasing() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsColumnAliasing(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsColumnAliasing());
+ }
+
+ public void testSetNullPlusNonNullIsNull() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setNullPlusNonNullIsNull(VALUE);
+ // check
+ assertSame(VALUE, bean.isNullPlusNonNullIsNull());
+ }
+
+ public void testSetSupportsConvert() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsConvert(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsConvert());
+ }
+
+ public void testGetSupportedConversions() {
+ // get
+ Set<SqlTypeConversionPair> set = bean.getSupportedConversions();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSqlTypeConversionPair() {
+ // create
+ SqlTypeConversionPair object = new DefaultModelFactory().createSqlTypeConversionPair();
+ // set
+ object.setSrcType(SqlType.INTEGER);
+ object.setDestType(SqlType.VARCHAR);
+
+ // add
+ bean.addSqlTypeConversionPair(object);
+ // check
+ assertFalse(bean.getSupportedConversions().isEmpty());
+ }
+
+ public void testDeleteSqlTypeConversionPair() {
+ // create
+ SqlTypeConversionPair object = new DefaultModelFactory().createSqlTypeConversionPair();
+ // set
+ object.setSrcType(SqlType.INTEGER);
+ object.setDestType(SqlType.VARCHAR);
+
+ // add
+ bean.addSqlTypeConversionPair(object);
+ // check
+ assertFalse(bean.getSupportedConversions().isEmpty());
+
+ // delete
+ bean.deleteSqlTypeConversionPair(object);
+ // check
+ assertTrue(bean.getSupportedConversions().isEmpty());
+ }
+
+ public void testFindSqlTypeConversionPair() {
+ // create
+ SqlTypeConversionPair object = new DefaultModelFactory().createSqlTypeConversionPair();
+ // set
+ object.setSrcType(SqlType.INTEGER);
+ object.setDestType(SqlType.VARCHAR);
+
+ // add
+ bean.addSqlTypeConversionPair(object);
+ // check
+ assertFalse(bean.findSqlTypeConversionPairBySrcType(object.getSrcType().toString()).isEmpty());
+ }
+
+ public void testSetSupportsTableCorrelationNames() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsTableCorrelationNames(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsTableCorrelationNames());
+ }
+
+ public void testSetSupportsDifferentTableCorrelationNames() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsDifferentTableCorrelationNames(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsDifferentTableCorrelationNames());
+ }
+
+ public void testSetSupportsExpressionsInOrderBy() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsExpressionsInOrderBy(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsExpressionsInOrderBy());
+ }
+
+ public void testSetSupportsOrderByUnrelated() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOrderByUnrelated(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOrderByUnrelated());
+ }
+
+ public void testSetSupportsGroupBy() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsGroupBy(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsGroupBy());
+ }
+
+ public void testSetSupportsGroupByUnrelated() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsGroupByUnrelated(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsGroupByUnrelated());
+ }
+
+ public void testSetSupportsGroupByBeyondSelect() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsGroupByBeyondSelect(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsGroupByBeyondSelect());
+ }
+
+ public void testSetSupportsLikeEscapeClause() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsLikeEscapeClause(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsLikeEscapeClause());
+ }
+
+ public void testSetSupportsMultipleResultSets() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMultipleResultSets(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMultipleResultSets());
+ }
+
+ public void testSetSupportsMultipleTransactions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMultipleTransactions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMultipleTransactions());
+ }
+
+ public void testSetSupportsNonNullableColumns() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsNonNullableColumns(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsNonNullableColumns());
+ }
+
+ public void testSetSupportsMinimumSQLGrammar() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMinimumSQLGrammar(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMinimumSQLGrammar());
+ }
+
+ public void testSetSupportsCoreSQLGrammar() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCoreSQLGrammar(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCoreSQLGrammar());
+ }
+
+ public void testSetSupportsExtendedSQLGrammar() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsExtendedSQLGrammar(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsExtendedSQLGrammar());
+ }
+
+ public void testSetSupportsANSI92EntryLevelSQL() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsANSI92EntryLevelSQL(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsANSI92EntryLevelSQL());
+ }
+
+ public void testSetSupportsANSI92IntermediateSQL() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsANSI92IntermediateSQL(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsANSI92IntermediateSQL());
+ }
+
+ public void testSetSupportsANSI92FullSQL() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsANSI92FullSQL(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsANSI92FullSQL());
+ }
+
+ public void testSetSupportsIntegrityEnhancementFacility() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsIntegrityEnhancementFacility(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsIntegrityEnhancementFacility());
+ }
+
+ public void testSetSupportsOuterJoins() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOuterJoins(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOuterJoins());
+ }
+
+ public void testSetSupportsFullOuterJoins() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsFullOuterJoins(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsFullOuterJoins());
+ }
+
+ public void testSetSupportsLimitedOuterJoins() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsLimitedOuterJoins(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsLimitedOuterJoins());
+ }
+
+ public void testSetSchemaTerm() {
+ String VALUE = "My value";
+ // set
+ bean.setSchemaTerm(VALUE);
+ // check
+ assertSame(VALUE, bean.getSchemaTerm());
+ }
+
+ public void testSetProcedureTerm() {
+ String VALUE = "My value";
+ // set
+ bean.setProcedureTerm(VALUE);
+ // check
+ assertSame(VALUE, bean.getProcedureTerm());
+ }
+
+ public void testSetCatalogTerm() {
+ String VALUE = "My value";
+ // set
+ bean.setCatalogTerm(VALUE);
+ // check
+ assertSame(VALUE, bean.getCatalogTerm());
+ }
+
+ public void testSetCatalogAtStart() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setCatalogAtStart(VALUE);
+ // check
+ assertSame(VALUE, bean.isCatalogAtStart());
+ }
+
+ public void testSetCatalogSeparator() {
+ String VALUE = "My value";
+ // set
+ bean.setCatalogSeparator(VALUE);
+ // check
+ assertSame(VALUE, bean.getCatalogSeparator());
+ }
+
+ public void testSetSupportsSchemasInDataManipulation() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSchemasInDataManipulation(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSchemasInDataManipulation());
+ }
+
+ public void testSetSupportsSchemasInProcedureCalls() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSchemasInProcedureCalls(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSchemasInProcedureCalls());
+ }
+
+ public void testSetSupportsSchemasInTableDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSchemasInTableDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSchemasInTableDefinitions());
+ }
+
+ public void testSetSupportsSchemasInIndexDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSchemasInIndexDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSchemasInIndexDefinitions());
+ }
+
+ public void testSetSupportsSchemasInPrivilegeDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSchemasInPrivilegeDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSchemasInPrivilegeDefinitions());
+ }
+
+ public void testSetSupportsCatalogsInDataManipulation() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCatalogsInDataManipulation(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCatalogsInDataManipulation());
+ }
+
+ public void testSetSupportsCatalogsInProcedureCalls() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCatalogsInProcedureCalls(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCatalogsInProcedureCalls());
+ }
+
+ public void testSetSupportsCatalogsInTableDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCatalogsInTableDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCatalogsInTableDefinitions());
+ }
+
+ public void testSetSupportsCatalogsInIndexDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCatalogsInIndexDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCatalogsInIndexDefinitions());
+ }
+
+ public void testSetSupportsCatalogsInPrivilegeDefinitions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCatalogsInPrivilegeDefinitions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCatalogsInPrivilegeDefinitions());
+ }
+
+ public void testSetSupportsPositionedDelete() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsPositionedDelete(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsPositionedDelete());
+ }
+
+ public void testSetSupportsPositionedUpdate() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsPositionedUpdate(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsPositionedUpdate());
+ }
+
+ public void testSetSupportsSelectForUpdate() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSelectForUpdate(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSelectForUpdate());
+ }
+
+ public void testSetSupportsStoredProcedures() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsStoredProcedures(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsStoredProcedures());
+ }
+
+ public void testSetSupportsSubqueriesInComparisons() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSubqueriesInComparisons(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSubqueriesInComparisons());
+ }
+
+ public void testSetSupportsSubqueriesInExists() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSubqueriesInExists(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSubqueriesInExists());
+ }
+
+ public void testSetSupportsSubqueriesInIns() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSubqueriesInIns(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSubqueriesInIns());
+ }
+
+ public void testSetSupportsSubqueriesInQuantifieds() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSubqueriesInQuantifieds(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSubqueriesInQuantifieds());
+ }
+
+ public void testSetSupportsCorrelatedSubqueries() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsCorrelatedSubqueries(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsCorrelatedSubqueries());
+ }
+
+ public void testSetSupportsUnion() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsUnion(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsUnion());
+ }
+
+ public void testSetSupportsUnionAll() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsUnionAll(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsUnionAll());
+ }
+
+ public void testSetSupportsOpenCursorsAcrossCommit() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOpenCursorsAcrossCommit(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOpenCursorsAcrossCommit());
+ }
+
+ public void testSetSupportsOpenCursorsAcrossRollback() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOpenCursorsAcrossRollback(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOpenCursorsAcrossRollback());
+ }
+
+ public void testSetSupportsOpenStatementsAcrossCommit() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOpenStatementsAcrossCommit(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOpenStatementsAcrossCommit());
+ }
+
+ public void testSetSupportsOpenStatementsAcrossRollback() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsOpenStatementsAcrossRollback(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsOpenStatementsAcrossRollback());
+ }
+
+ public void testSetMaxBinaryLiteralLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxBinaryLiteralLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxBinaryLiteralLength());
+ }
+
+ public void testSetMaxCharLiteralLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxCharLiteralLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxCharLiteralLength());
+ }
+
+ public void testSetMaxColumnNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnNameLength());
+ }
+
+ public void testSetMaxColumnsInGroupBy() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnsInGroupBy(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnsInGroupBy());
+ }
+
+ public void testSetMaxColumnsInIndex() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnsInIndex(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnsInIndex());
+ }
+
+ public void testSetMaxColumnsInOrderBy() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnsInOrderBy(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnsInOrderBy());
+ }
+
+ public void testSetMaxColumnsInSelect() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnsInSelect(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnsInSelect());
+ }
+
+ public void testSetMaxColumnsInTable() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxColumnsInTable(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxColumnsInTable());
+ }
+
+ public void testSetMaxConnections() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxConnections(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxConnections());
+ }
+
+ public void testSetMaxCursorNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxCursorNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxCursorNameLength());
+ }
+
+ public void testSetMaxIndexLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxIndexLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxIndexLength());
+ }
+
+ public void testSetMaxSchemaNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxSchemaNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxSchemaNameLength());
+ }
+
+ public void testSetMaxProcedureNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxProcedureNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxProcedureNameLength());
+ }
+
+ public void testSetMaxCatalogNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxCatalogNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxCatalogNameLength());
+ }
+
+ public void testSetMaxRowSize() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxRowSize(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxRowSize());
+ }
+
+ public void testSetMaxRowSizeIncludeBlobs() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setMaxRowSizeIncludeBlobs(VALUE);
+ // check
+ assertSame(VALUE, bean.isMaxRowSizeIncludeBlobs());
+ }
+
+ public void testSetMaxStatementLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxStatementLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxStatementLength());
+ }
+
+ public void testSetMaxStatements() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxStatements(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxStatements());
+ }
+
+ public void testSetMaxTableNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxTableNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxTableNameLength());
+ }
+
+ public void testSetMaxTablesInSelect() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxTablesInSelect(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxTablesInSelect());
+ }
+
+ public void testSetMaxUserNameLength() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setMaxUserNameLength(VALUE);
+ // check
+ assertSame(VALUE, bean.getMaxUserNameLength());
+ }
+
+ public void testSetDefaultTransactionIsolation() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setDefaultTransactionIsolation(VALUE);
+ // check
+ assertSame(VALUE, bean.getDefaultTransactionIsolation());
+ }
+
+ public void testSetSupportsTransactions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsTransactions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsTransactions());
+ }
+
+ public void testGetSupportedTransactionIsolationLevels() {
+ // get
+ Set<TransactionIsolationLevelType> set = bean.getSupportedTransactionIsolationLevels();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSupportedTransactionIsolationLevelType() {
+ // get
+ TransactionIsolationLevelType object = TransactionIsolationLevelType.READ_COMMITTED;
+ // add
+ bean.addSupportedTransactionIsolationLevelType(object);
+ // check
+ assertFalse(bean.getSupportedTransactionIsolationLevels().isEmpty());
+ }
+
+ public void testDeleteSupportedTransactionIsolationLevelType() {
+ // get
+ TransactionIsolationLevelType object = TransactionIsolationLevelType.READ_COMMITTED;
+ // add
+ bean.addSupportedTransactionIsolationLevelType(object);
+ // check
+ assertFalse(bean.getSupportedTransactionIsolationLevels().isEmpty());
+
+ // delete
+ bean.deleteSupportedTransactionIsolationLevelType(object);
+ // check
+ assertTrue(bean.getSupportedTransactionIsolationLevels().isEmpty());
+ }
+
+ public void testIsSupportedTransactionIsolationLevelType() {
+ // get
+ TransactionIsolationLevelType object = TransactionIsolationLevelType.READ_COMMITTED;
+ // add
+ bean.addSupportedTransactionIsolationLevelType(object);
+ // check
+ assertSame(Boolean.TRUE, bean.isSupportedTransactionIsolationLevelType(object));
+ }
+
+ public void testSetSupportsDataDefinitionAndDataManipulationTransactions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsDataDefinitionAndDataManipulationTransactions(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsDataDefinitionAndDataManipulationTransactions());
+ }
+
+ public void testSetSupportsDataManipulationTransactionsOnly() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsDataManipulationTransactionsOnly(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsDataManipulationTransactionsOnly());
+ }
+
+ public void testSetDataDefinitionCausesTransactionCommit() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setDataDefinitionCausesTransactionCommit(VALUE);
+ // check
+ assertSame(VALUE, bean.isDataDefinitionCausesTransactionCommit());
+ }
+
+ public void testSetDataDefinitionIgnoredInTransactions() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setDataDefinitionIgnoredInTransactions(VALUE);
+ // check
+ assertSame(VALUE, bean.isDataDefinitionIgnoredInTransactions());
+ }
+
+ public void testGetStoredProcedures() {
+ // get
+ Set<StoredProcedure> set = bean.getStoredProcedures();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddStoredProcedure() {
+ String NAME = "My Name";
+ // create
+ StoredProcedure object = new DefaultModelFactory().createStoredProcedure();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addStoredProcedure(object);
+ // check
+ assertFalse(bean.getStoredProcedures().isEmpty());
+ }
+
+ public void testDeleteStoredProcedure() {
+ String NAME = "My Name";
+ // create
+ StoredProcedure object = new DefaultModelFactory().createStoredProcedure();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addStoredProcedure(object);
+ // check
+ assertFalse(bean.getStoredProcedures().isEmpty());
+
+ // delete
+ bean.deleteStoredProcedure(object);
+ // check
+ assertTrue(bean.getStoredProcedures().isEmpty());
+ }
+
+ public void testFindStoredProcedureByName() {
+ String NAME = "My Name";
+ // create
+ StoredProcedure object = new DefaultModelFactory().createStoredProcedure();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addStoredProcedure(object);
+ // check
+ assertSame(object, bean.findStoredProcedureByName(null, null, object.getName()));
+ }
+
+ public void testGetTables() {
+ // get
+ Set<Table> set = bean.getTables();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddTable() {
+ String NAME = "My Name";
+ // create
+ Table object = new DefaultModelFactory().createTable();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTable(object);
+ // check
+ assertFalse(bean.getTables().isEmpty());
+ }
+
+ public void testDeleteTable() {
+ String NAME = "My Name";
+ // create
+ Table object = new DefaultModelFactory().createTable();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTable(object);
+ // check
+ assertFalse(bean.getTables().isEmpty());
+
+ // delete
+ bean.deleteTable(object);
+ // check
+ assertTrue(bean.getTables().isEmpty());
+ }
+
+ public void testFindTableByName() {
+ String NAME = "My Name";
+ // create
+ Table object = new DefaultModelFactory().createTable();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTable(object);
+ // check
+ assertSame(object, bean.findTableByName(null, null, object.getName()));
+ }
+
+ public void testGetSchemas() {
+ // get
+ Set<Schema> set = bean.getSchemas();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSchema() {
+ String NAME = "My Name";
+ // create
+ Schema object = new DefaultModelFactory().createSchema();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSchema(object);
+ // check
+ assertFalse(bean.getSchemas().isEmpty());
+ }
+
+ public void testDeleteSchema() {
+ String NAME = "My Name";
+ // create
+ Schema object = new DefaultModelFactory().createSchema();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSchema(object);
+ // check
+ assertFalse(bean.getSchemas().isEmpty());
+
+ // delete
+ bean.deleteSchema(object);
+ // check
+ assertTrue(bean.getSchemas().isEmpty());
+ }
+
+ public void testFindSchemaByName() {
+ String NAME = "My Name";
+ // create
+ Schema object = new DefaultModelFactory().createSchema();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSchema(object);
+ // check
+ assertSame(object, bean.findSchemaByName(null, object.getName()));
+ }
+
+ public void testGetCatalogs() {
+ // get
+ Set<Catalog> set = bean.getCatalogs();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddCatalog() {
+ String NAME = "My Name";
+ // create
+ Catalog object = new DefaultModelFactory().createCatalog();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addCatalog(object);
+ // check
+ assertFalse(bean.getCatalogs().isEmpty());
+ }
+
+ public void testDeleteCatalog() {
+ String NAME = "My Name";
+ // create
+ Catalog object = new DefaultModelFactory().createCatalog();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addCatalog(object);
+ // check
+ assertFalse(bean.getCatalogs().isEmpty());
+
+ // delete
+ bean.deleteCatalog(object);
+ // check
+ assertTrue(bean.getCatalogs().isEmpty());
+ }
+
+ public void testFindCatalogByName() {
+ String NAME = "My Name";
+ // create
+ Catalog object = new DefaultModelFactory().createCatalog();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addCatalog(object);
+ // check
+ assertSame(object, bean.findCatalogByName(object.getName()));
+ }
+
+ public void testGetTableTypes() {
+ // get
+ Set<TableType> set = bean.getTableTypes();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddTableType() {
+ String NAME = "My Name";
+ // create
+ TableType object = new DefaultModelFactory().createTableType();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTableType(object);
+ // check
+ assertFalse(bean.getTableTypes().isEmpty());
+ }
+
+ public void testDeleteTableType() {
+ String NAME = "My Name";
+ // create
+ TableType object = new DefaultModelFactory().createTableType();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTableType(object);
+ // check
+ assertFalse(bean.getTableTypes().isEmpty());
+
+ // delete
+ bean.deleteTableType(object);
+ // check
+ assertTrue(bean.getTableTypes().isEmpty());
+ }
+
+ public void testFindTableTypeByTypeName() {
+ String NAME = "My Name";
+ // create
+ TableType object = new DefaultModelFactory().createTableType();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addTableType(object);
+ // check
+ assertSame(object, bean.findTableTypeByTypeName(object.getName()));
+ }
+
+ public void testGetSqlTypeInfos() {
+ // get
+ Set<SqlTypeInfo> set = bean.getSqlTypeInfos();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSqlTypeInfo() {
+ String NAME = "My Name";
+ // create
+ SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSqlTypeInfo(object);
+ // check
+ assertFalse(bean.getSqlTypeInfos().isEmpty());
+ }
+
+ public void testDeleteSqlTypeInfo() {
+ String NAME = "My Name";
+ // create
+ SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSqlTypeInfo(object);
+ // check
+ assertFalse(bean.getSqlTypeInfos().isEmpty());
+ // delete
+ bean.deleteSqlTypeInfo(object);
+ // check
+ assertTrue(bean.getSqlTypeInfos().isEmpty());
+ }
+
+ public void testFindSqlTypeInfoByTypeName() {
+ String NAME = "My Name";
+ // create
+ SqlTypeInfo object = new DefaultModelFactory().createSqlTypeInfo();
+ // set
+ object.setName(NAME);
+ // add
+ bean.addSqlTypeInfo(object);
+ // check
+ assertSame(object, bean.findSqlTypeInfoByTypeName(object.getName()));
+ }
+
+ public void testGetSupportedResultSetTypes() {
+ // get
+ Set<ResultSetType> set = bean.getSupportedResultSetTypes();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSupportedResultSetType() {
+ // add
+ bean.addSupportedResultSetType(ResultSetType.SCROLL_INSENSITIVE);
+ // check
+ assertFalse(bean.getSupportedResultSetTypes().isEmpty());
+ }
+
+ public void testDeleteSupportedResultSetType() {
+ // add
+ bean.addSupportedResultSetType(ResultSetType.SCROLL_INSENSITIVE);
+ // check
+ assertFalse(bean.getSupportedResultSetTypes().isEmpty());
+
+ // delete
+ bean.deleteSupportedResultSetType(ResultSetType.SCROLL_INSENSITIVE);
+ // check
+ assertTrue(bean.getSupportedResultSetTypes().isEmpty());
+ }
+
+ public void testGetSupportedForwardOnlyResultSetConcurrencies() {
+ // get
+ Set<ResultSetConcurrencyType> set = bean.getSupportedForwardOnlyResultSetConcurrencies();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSupportedForwardOnlyResultSetConcurrency() {
+ // add
+ bean.addSupportedForwardOnlyResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedForwardOnlyResultSetConcurrencies().isEmpty());
+ }
+
+ public void testDeleteSupportedForwardOnlyResultSetConcurrency() {
+ // add
+ bean.addSupportedForwardOnlyResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedForwardOnlyResultSetConcurrencies().isEmpty());
+ // delete
+ bean.deleteSupportedForwardOnlyResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertTrue(bean.getSupportedForwardOnlyResultSetConcurrencies().isEmpty());
+ }
+
+ public void testGetSupportedScrollInsensitiveResultSetConcurrencies() {
+ // get
+ Set<ResultSetConcurrencyType> set = bean.getSupportedScrollInsensitiveResultSetConcurrencies();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSupportedScrollInsensitiveResultSetConcurrency() {
+ // add
+ bean.addSupportedScrollInsensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedScrollInsensitiveResultSetConcurrencies().isEmpty());
+ }
+
+ public void testDeleteSupportedScrollInsensitiveResultSetConcurrency() {
+ // add
+ bean.addSupportedScrollInsensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedScrollInsensitiveResultSetConcurrencies().isEmpty());
+ // delete
+ bean.deleteSupportedScrollInsensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertTrue(bean.getSupportedScrollInsensitiveResultSetConcurrencies().isEmpty());
+ }
+
+ public void testGetSupportedScrollSensitiveResultSetConcurrencies() {
+ // get
+ Set<ResultSetConcurrencyType> set = bean.getSupportedScrollSensitiveResultSetConcurrencies();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddSupportedScrollSensitiveResultSetConcurrency() {
+ // add
+ bean.addSupportedScrollSensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedScrollSensitiveResultSetConcurrencies().isEmpty());
+ }
+
+ public void testDeleteSupportedScrollSensitiveResultSetConcurrency() {
+ // add
+ bean.addSupportedScrollSensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertFalse(bean.getSupportedScrollSensitiveResultSetConcurrencies().isEmpty());
+ // delete
+ bean.deleteSupportedScrollSensitiveResultSetConcurrency(ResultSetConcurrencyType.UPDATABLE);
+ // check
+ assertTrue(bean.getSupportedScrollSensitiveResultSetConcurrencies().isEmpty());
+ }
+
+ public void testSetForwardOnlyResultSetOwnUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetOwnUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetOwnUpdatesAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOwnUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOwnUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOwnUpdatesAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOwnUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOwnUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOwnUpdatesAreVisible());
+ }
+
+ public void testSetForwardOnlyResultSetOwnDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetOwnDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetOwnDeletesAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOwnDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOwnDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOwnDeletesAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOwnDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOwnDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOwnDeletesAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOwnInsertsAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOwnInsertsAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOwnInsertsAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOwnInsertsAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOwnInsertsAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOwnInsertsAreVisible());
+ }
+
+ public void testSetForwardOnlyResultSetOthersUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetOthersUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetOthersUpdatesAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOthersUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOthersUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOthersUpdatesAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOthersUpdatesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOthersUpdatesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOthersUpdatesAreVisible());
+ }
+
+ public void testSetForwardOnlyResultSetOthersDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetOthersDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetOthersDeletesAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOthersDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOthersDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOthersDeletesAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOthersDeletesAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOthersDeletesAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOthersDeletesAreVisible());
+ }
+
+ public void testSetForwardOnlyResultSetOthersInsertsAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetOthersInsertsAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetOthersInsertsAreVisible());
+ }
+
+ public void testSetScrollInsensitiveResultSetOthersInsertsAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetOthersInsertsAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetOthersInsertsAreVisible());
+ }
+
+ public void testSetScrollSensitiveResultSetOthersInsertsAreVisible() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetOthersInsertsAreVisible(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetOthersInsertsAreVisible());
+ }
+
+ public void testSetForwardOnlyResultSetUpdatesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetUpdatesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetUpdatesAreDetected());
+ }
+
+ public void testSetScrollInsensitiveResultSetUpdatesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetUpdatesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetUpdatesAreDetected());
+ }
+
+ public void testSetScrollSensitiveResultSetUpdatesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetUpdatesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetUpdatesAreDetected());
+ }
+
+ public void testSetForwardOnlyResultSetDeletesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultSetDeletesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultSetDeletesAreDetected());
+ }
+
+ public void testSetScrollInsensitiveResultSetDeletesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultSetDeletesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultSetDeletesAreDetected());
+ }
+
+ public void testSetScrollSensitiveResultSetDeletesAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultSetDeletesAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultSetDeletesAreDetected());
+ }
+
+ public void testSetForwardOnlyResultInsertsAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setForwardOnlyResultInsertsAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isForwardOnlyResultInsertsAreDetected());
+ }
+
+ public void testSetScrollInsensitiveResultInsertsAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollInsensitiveResultInsertsAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollInsensitiveResultInsertsAreDetected());
+ }
+
+ public void testSetScrollSensitiveResultInsertsAreDetected() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setScrollSensitiveResultInsertsAreDetected(VALUE);
+ // check
+ assertSame(VALUE, bean.isScrollSensitiveResultInsertsAreDetected());
+ }
+
+ public void testSetSupportsBatchUpdates() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsBatchUpdates(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsBatchUpdates());
+ }
+
+ public void testGetUserDefinedTypes() {
+ // get
+ Set<UserDefinedType> set = bean.getUserDefinedTypes();
+ // check
+ assertNotNull(set);
+ assertTrue(set.isEmpty());
+ }
+
+ public void testAddUserDefinedType() {
+ String NAME = "My name";
+ // create
+ UserDefinedType object = new DefaultModelFactory().createUserDefinedType();
+ // set name
+ object.setName(NAME);
+ // add
+ bean.addUserDefinedType(object);
+ // check
+ assertFalse(bean.getUserDefinedTypes().isEmpty());
+ }
+
+ public void testDeleteUserDefinedType() {
+ String NAME = "My name";
+ // create
+ UserDefinedType object = new DefaultModelFactory().createUserDefinedType();
+ // set name
+ object.setName(NAME);
+ // add
+ bean.addUserDefinedType(object);
+ // check
+ assertFalse(bean.getUserDefinedTypes().isEmpty());
+ // delete
+ bean.deleteUserDefinedType(object);
+ // check
+ assertTrue(bean.getUserDefinedTypes().isEmpty());
+ }
+
+ public void testFindUserDefinedTypeByName() {
+ String NAME = "My name";
+ // create
+ UserDefinedType object = new DefaultModelFactory().createUserDefinedType();
+ // set name
+ object.setName(NAME);
+ // add
+ bean.addUserDefinedType(object);
+ // check
+ assertSame(object, bean.findUserDefinedTypeByName(null, null, object.getName()));
+ }
+
+ public void testSetSupportsSavepoints() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsSavepoints(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsSavepoints());
+ }
+
+ public void testSetSupportsNamedParameters() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsNamedParameters(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsNamedParameters());
+ }
+
+ public void testSetSupportsMultipleOpenResults() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsMultipleOpenResults(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsMultipleOpenResults());
+ }
+
+ public void testSetSupportsGetGeneratedKeys() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsGetGeneratedKeys(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsGetGeneratedKeys());
+ }
+
+ public void testSetSupportsResultSetHoldCurrorsOverCommitHoldability() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsResultSetHoldCurrorsOverCommitHoldability(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsResultSetHoldCurrorsOverCommitHoldability());
+ }
+
+ public void testSetSupportsResultSetCloseCurrorsAtCommitHoldability() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsResultSetCloseCurrorsAtCommitHoldability(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsResultSetCloseCurrorsAtCommitHoldability());
+ }
+
+ public void testSetResultSetHoldabilityType() {
+ // set
+ bean.setResultSetHoldabilityType(ResultSetHoldabilityType.HOLD_CURSORS_OVER_COMMIT);
+ // check
+ assertSame(ResultSetHoldabilityType.HOLD_CURSORS_OVER_COMMIT, bean.getResultSetHoldabilityType());
+ }
+
+ public void testSetDatabaseMajorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setDatabaseMajorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDatabaseMajorVersion());
+ }
+
+ public void testSetDatabaseMinorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setDatabaseMinorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getDatabaseMinorVersion());
+ }
+
+ public void testSetJDBCMajorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setJDBCMajorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getJDBCMajorVersion());
+ }
+
+ public void testSetJDBCMinorVersion() {
+ Integer VALUE = new Integer(1);
+ // set
+ bean.setJDBCMinorVersion(VALUE);
+ // check
+ assertSame(VALUE, bean.getJDBCMinorVersion());
+ }
+
+ public void testSetSQLStateType() {
+ // set
+ bean.setSQLStateType(SQLStateType.SQL99);
+ // check
+ assertSame(SQLStateType.SQL99, bean.getSQLStateType());
+ }
+
+ public void testSetLocatorsUpdateCopy() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setLocatorsUpdateCopy(VALUE);
+ // check
+ assertSame(VALUE, bean.isLocatorsUpdateCopy());
+ }
+
+ public void testSetSupportsStatementPooling() {
+ Boolean VALUE = Boolean.TRUE;
+ // set
+ bean.setSupportsStatementPooling(VALUE);
+ // check
+ assertSame(VALUE, bean.isSupportsStatementPooling());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/DatabaseNamedObjectBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Map;
+import org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject;
+import org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean;
+
+/**
+ * DatabaseNamedObjectBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseNamedObjectBeanTest extends TestCase {
+
+ private DatabaseNamedObject bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new DatabaseNamedObjectBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetName() {
+ String name = "My Name";
+ // set
+ bean.setName(name);
+ // check
+ assertSame("Unable to set name", name, bean.getName());
+ }
+
+ public void testSetRemarks() {
+ String remarks = "My remarks";
+ // set
+ bean.setRemarks(remarks);
+ // check
+ assertSame("Unable to set remarks", remarks, bean.getRemarks());
+ }
+
+ public void testGetExtraProperties() {
+ // get
+ Map<String, Object> properties = bean.getExtraProperties();
+ // check
+ assertNotNull("ExtraProperties should not be null by default", properties);
+ // check
+ assertTrue("ExtraProperties should be empty", properties.isEmpty());
+ }
+
+ public void testAddExtraProperty() {
+ String key = "My key";
+ String value = "My Value";
+ // set
+ bean.addExtraProperty(key, value);
+ // check
+ assertSame("Unable to set extra property", value, bean.getExtraProperty(key));
+ }
+
+ public void testDeleteExtraProperty() {
+ String key = "My key";
+ String value = "My Value";
+ // set
+ bean.addExtraProperty(key, value);
+ // check
+ assertFalse("ExtraProperties should not be empty", bean.getExtraProperties().isEmpty());
+
+ // delete
+ bean.deleteExtraProperty(key);
+ // check
+ assertTrue("ExtraProperties should be empty", bean.getExtraProperties().isEmpty());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.spi.ForeignKeyBean;
+import org.jboss.dna.common.jdbc.model.api.Column;
+import org.jboss.dna.common.jdbc.model.api.ForeignKey;
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.KeyDeferrabilityType;
+import org.jboss.dna.common.jdbc.model.api.KeyModifyRuleType;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.Table;
+
+/**
+ * ForeignKeyBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ForeignKeyBeanTest extends TestCase {
+
+ private ForeignKey bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new ForeignKeyBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testGetColumns() {
+ Set<ForeignKeyColumn> columns = bean.getColumns();
+ // check
+ assertNotNull("Unable to get columns", columns);
+ assertTrue("Column set should be empty by default", columns.isEmpty());
+ }
+
+ public void testAddColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ ForeignKeyColumn column = new DefaultModelFactory().createForeignKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testDeleteColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ ForeignKeyColumn column = new DefaultModelFactory().createForeignKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+
+ // delete
+ bean.deleteColumn(column);
+ // check
+ assertTrue("Column set should be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testFindColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ ForeignKeyColumn column = new DefaultModelFactory().createForeignKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
+ }
+
+ public void testSetSourceTable() {
+ // create
+ Table sourceTable = new DefaultModelFactory().createTable();
+ // set
+ bean.setSourceTable(sourceTable);
+ // check
+ assertSame("Unable to set source table", sourceTable, bean.getSourceTable());
+ }
+
+ public void testSetSourcePrimaryKey() {
+ // create
+ PrimaryKey primaryKey = new DefaultModelFactory().createPrimaryKey();
+ // set
+ bean.setSourcePrimaryKey(primaryKey);
+ // check
+ assertSame("Unable to set source primary key", primaryKey, bean.getSourcePrimaryKey());
+ }
+
+ public void testSetUpdateRule() {
+ // set
+ bean.setUpdateRule(KeyModifyRuleType.CASCADE);
+ // check
+ assertSame("unable to set update rule", KeyModifyRuleType.CASCADE, bean.getUpdateRule());
+ }
+
+ public void testSetDeleteRule() {
+ // set
+ bean.setDeleteRule(KeyModifyRuleType.SET_NULL);
+ // check
+ assertSame("unable to set delete rule", KeyModifyRuleType.SET_NULL, bean.getDeleteRule());
+ }
+
+ public void testSetDeferrability() {
+ // set
+ bean.setDeferrability(KeyDeferrabilityType.INITIALLY_DEFERRED);
+ // check
+ assertSame("unable to set deferrability", KeyDeferrabilityType.INITIALLY_DEFERRED, bean.getDeferrability());
+
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ForeignKeyColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+
+/**
+ * ForeignKeyColumnBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ForeignKeyColumnBeanTest extends TestCase {
+
+ private ForeignKeyColumn bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new ForeignKeyColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ /**
+ * test SetSourceColumn
+ */
+ public void testSetSourceColumn() {
+ // create source column
+ TableColumn sourceColumn = new DefaultModelFactory().createTableColumn();
+ // set
+ bean.setSourceColumn(sourceColumn);
+ // check that it was really set
+ assertSame("Unable to set source column", sourceColumn, bean.getSourceColumn());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.Index;
+import org.jboss.dna.common.jdbc.model.api.IndexColumn;
+import org.jboss.dna.common.jdbc.model.api.IndexType;
+
+/**
+ * IndexBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class IndexBeanTest extends TestCase {
+ private Index bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new IndexBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testGetColumns() {
+ // get columns
+ Set<IndexColumn> columns = bean.getColumns();
+ // check
+ assertNotNull("Unable to get columns", columns);
+ assertTrue("Column set should be empty by default", columns.isEmpty());
+ }
+
+ public void testAddColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ IndexColumn column = new DefaultModelFactory().createIndexColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testDeleteColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ IndexColumn column = new DefaultModelFactory().createIndexColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+
+ // delete
+ bean.deleteColumn(column);
+ // check
+ assertTrue("Column set should be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testFindColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ IndexColumn column = new DefaultModelFactory().createIndexColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
+ }
+
+ public void testSetUnique() {
+ Boolean unique = Boolean.TRUE;
+ // set
+ bean.setUnique(unique);
+ // check that it was set
+ assertSame("Unable to set unique", unique, bean.isUnique());
+ }
+
+ public void testSetIndexType() {
+ // set
+ bean.setIndexType(IndexType.CLUSTERED);
+ // check
+ assertSame("Unable to set index type", IndexType.CLUSTERED, bean.getIndexType());
+ }
+
+ public void testSetCardinality() {
+ Integer cardinality = new Integer(1);
+ // set
+ bean.setCardinality(cardinality);
+ // check
+ assertSame("Unable to set cardinality", cardinality, bean.getCardinality());
+ }
+
+ public void testSetPages() {
+ Integer pages = new Integer(1);
+ // set
+ bean.setPages(pages);
+ // check
+ assertSame("Unable to set pages", pages, bean.getPages());
+ }
+
+ public void testSetFilterCondition() {
+ String filterCondition = "IS NOT NULL";
+ // set
+ bean.setFilterCondition(filterCondition);
+
+ // check
+ assertSame("Unable to set filter condition", filterCondition, bean.getFilterCondition());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/IndexColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.IndexColumn;
+import org.jboss.dna.common.jdbc.model.api.SortSequenceType;
+
+/**
+ * IndexColumnBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class IndexColumnBeanTest extends TestCase {
+ private IndexColumn bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new IndexColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetSortSequenceType() {
+ // set
+ bean.setSortSequenceType(SortSequenceType.DESCENDING);
+ // check
+ assertSame("Unable to set sort sequence type", SortSequenceType.DESCENDING, bean.getSortSequenceType());
+
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/KeyColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.KeyColumn;
+
+/**
+ * KeyColumnBean test
+ */
+public class KeyColumnBeanTest extends TestCase {
+
+ private KeyColumn bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new KeyColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testKeyColumnBean() {
+ assertNotNull("Unable to create KeyColumn", bean);
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ParameterBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ParameterBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ParameterBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.Parameter;
+import org.jboss.dna.common.jdbc.model.api.ParameterIoType;
+
+/**
+ * ParameterBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ParameterBeanTest extends TestCase {
+ private Parameter bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new ParameterBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetIoType() {
+ // set
+ bean.setIoType(ParameterIoType.IN_OUT);
+ // check
+ assertSame("Unable to set I/O type", ParameterIoType.IN_OUT, bean.getIoType());
+ }
+
+ public void testSetScale() {
+ Integer scale = new Integer(3);
+ // set
+ bean.setScale(scale);
+ // check
+ assertSame("Unable to set scale", scale, bean.getScale());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKeyColumn;
+
+/**
+ * PrimaryKeyBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrimaryKeyBeanTest extends TestCase {
+
+ private PrimaryKey bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new PrimaryKeyBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testGetColumns() {
+ Set<PrimaryKeyColumn> columns = bean.getColumns();
+ // check
+ assertNotNull("Unable to get columns", columns);
+ assertTrue("Column set should be empty by default", columns.isEmpty());
+ }
+
+ public void testAddColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testDeleteColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+ // check
+ assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
+
+ // delete
+ bean.deleteColumn(column);
+ // check
+ assertTrue("Column set should be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testFindColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ PrimaryKeyColumn column = new DefaultModelFactory().createPrimaryKeyColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add column
+ bean.addColumn(column);
+
+ // check
+ assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrimaryKeyColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKeyColumn;
+
+/**
+ * PrimaryKeyColumnBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrimaryKeyColumnBeanTest extends TestCase {
+
+ private PrimaryKeyColumn bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new PrimaryKeyColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testPrimaryKeyColumnBean() {
+ assertNotNull("Unable to create PrimaryKeyColumn", bean);
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/PrivilegeBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,102 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+import org.jboss.dna.common.jdbc.model.api.PrivilegeType;
+
+/**
+ * PrivilegeBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class PrivilegeBeanTest extends TestCase {
+
+ private Privilege bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new PrivilegeBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetPrivilegeType() {
+ // set
+ bean.setPrivilegeType(PrivilegeType.UPDATE);
+ // check
+ assertSame("Unable to set priviledge", PrivilegeType.UPDATE, bean.getPrivilegeType());
+ }
+
+ public void testSetGrantor() {
+ String grantor = "Me";
+ // set
+ bean.setGrantor(grantor);
+ // check
+ assertEquals("Unable to set grantor", grantor, bean.getGrantor());
+ }
+
+ public void testSetGrantee() {
+ String grantee = "You";
+ // set
+ bean.setGrantee(grantee);
+ // check
+ assertEquals("Unable to set grantee", grantee, bean.getGrantee());
+ }
+
+ public void testSetName() {
+ String name = "The name";
+ // set
+ bean.setName(name);
+ // check
+ assertEquals("Unable to set name", name, bean.getName());
+ }
+
+ public void testSetGrantable() {
+ Boolean grantable = Boolean.TRUE;
+ // set
+ bean.setGrantable(grantable);
+ // check
+ assertSame("Unable to set grantable", grantable, bean.isGrantable());
+ }
+
+ public void testSetUnknownGrantable() {
+ Boolean unknownGrantable = Boolean.TRUE;
+ // set
+ bean.setUnknownGrantable(unknownGrantable);
+ // check
+ assertSame("Unable to set unknown grantable", unknownGrantable, bean.isUnknownGrantable());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/ReferenceBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.Reference;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.Table;
+
+/**
+ * ReferenceBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class ReferenceBeanTest extends TestCase {
+
+ private Reference bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new ReferenceBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetSourceTable() {
+ Table sourceTable = new DefaultModelFactory().createTable();
+ // set
+ bean.setSourceTable(sourceTable);
+ // check
+ assertSame("Unable to set source table", sourceTable, bean.getSourceTable());
+ }
+
+ public void testSetSourceDataType() {
+ // set
+ bean.setSourceDataType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set source data type", SqlType.VARCHAR, bean.getSourceDataType());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+
+/**
+ * SchemaBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SchemaBeanTest extends TestCase {
+
+ private Schema bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new SchemaBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetCatalog() {
+ Catalog catalog = new DefaultModelFactory().createCatalog();
+ // set
+ bean.setCatalog(catalog);
+ // check
+ assertSame("Unable to set catalog", catalog, bean.getCatalog());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SchemaObjectBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+import org.jboss.dna.common.jdbc.model.api.SchemaObject;
+
+/**
+ * SchemaObjectBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SchemaObjectBeanTest extends TestCase {
+
+ private SchemaObject bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new SchemaObjectBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetCatalog() {
+ Catalog catalog = new DefaultModelFactory().createCatalog();
+ // set
+ bean.setCatalog(catalog);
+ // check
+ assertSame("Unable to set catalog", catalog, bean.getCatalog());
+ }
+
+ public void testSetSchema() {
+ Schema schema = new DefaultModelFactory().createSchema();
+ // set
+ bean.setSchema(schema);
+ // check
+ assertSame("Unable to set schema", schema, bean.getSchema());
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeConversionPairBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.SqlTypeConversionPair;
+
+/**
+ * SqlTypeConversionPairBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SqlTypeConversionPairBeanTest extends TestCase {
+
+ private SqlTypeConversionPair bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new SqlTypeConversionPairBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetSrcType() {
+ // set
+ bean.setSrcType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set source type", SqlType.VARCHAR, bean.getSrcType());
+ }
+
+ public void testSetDestType() {
+ // set
+ bean.setDestType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set destination type", SqlType.VARCHAR, bean.getDestType());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/SqlTypeInfoBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.NullabilityType;
+import org.jboss.dna.common.jdbc.model.api.SearchabilityType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.api.SqlTypeInfo;
+
+/**
+ * SqlTypeInfoBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class SqlTypeInfoBeanTest extends TestCase {
+
+ private SqlTypeInfo bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new SqlTypeInfoBean();
+
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetLocalizedTypeName() {
+ String localizedTypeName = "Localized";
+ // set
+ bean.setLocalizedTypeName(localizedTypeName);
+ // check
+ assertEquals("Unable to set localized Type Name", localizedTypeName, bean.getLocalizedTypeName());
+ }
+
+ public void testSetNullabilityType() {
+ // set
+ bean.setNullabilityType(NullabilityType.NULLABLE);
+ // check
+ assertSame("Unable to set nullability type", NullabilityType.NULLABLE, bean.getNullabilityType());
+ }
+
+ public void testSetSqlType() {
+ // set
+ bean.setSqlType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set SQL type", SqlType.VARCHAR, bean.getSqlType());
+ }
+
+ public void testSetPrecision() {
+ Long precision = new Long(5);
+ // set
+ bean.setPrecision(precision);
+ // check
+ assertSame("Unable to set precision", precision, bean.getPrecision());
+ }
+
+ public void testSetFixedPrecisionScale() {
+ Boolean fixedPrecisionScale = Boolean.TRUE;
+ // set
+ bean.setFixedPrecisionScale(fixedPrecisionScale);
+ // check
+ assertSame("Unable to set fixed precision scale", fixedPrecisionScale, bean.isFixedPrecisionScale());
+ }
+
+ public void testSetNumberPrecisionRadix() {
+ Integer numberPrecisionRadix = new Integer(10);
+ // set
+ bean.setNumberPrecisionRadix(numberPrecisionRadix);
+ // check
+ assertSame("Unable to set number precision radix", numberPrecisionRadix, bean.getNumberPrecisionRadix());
+ }
+
+ public void testSetMinScale() {
+ Integer minScale = new Integer(1);
+ // set
+ bean.setMinScale(minScale);
+ // check
+ assertSame("Unable to set min scale", minScale, bean.getMinScale());
+ }
+
+ public void testSetMaxScale() {
+ Integer maxScale = new Integer(10);
+ // set
+ bean.setMaxScale(maxScale);
+ // check
+ assertSame("Unable to set max scale", maxScale, bean.getMaxScale());
+ }
+
+ public void testSetLiteralPrefix() {
+ String literalPrefix = "Prefix";
+ // set
+ bean.setLiteralPrefix(literalPrefix);
+ // check
+ assertEquals("Unable to set literal prefix", literalPrefix, bean.getLiteralPrefix());
+ }
+
+ public void testSetLiteralSuffix() {
+ String literalSuffix = "Suffix";
+ // set
+ bean.setLiteralSuffix(literalSuffix);
+ // check
+ assertEquals("Unable to set literal suffix", literalSuffix, bean.getLiteralSuffix());
+ }
+
+ public void testSetCreateParams() {
+ String createParams = "My params";
+ // set
+ bean.setCreateParams(createParams);
+ // check
+ assertEquals("Unable to set create params", createParams, bean.getCreateParams());
+ }
+
+ public void testSetCaseSensitive() {
+ Boolean caseSensitive = Boolean.TRUE;
+ // set
+ bean.setCaseSensitive(caseSensitive);
+ // check
+ assertSame("Unable to set case sensitive", caseSensitive, bean.isCaseSensitive());
+ }
+
+ public void testSetSearchabilityType() {
+ // set
+ bean.setSearchabilityType(SearchabilityType.BASIC);
+ // check
+ assertSame("Unable to set searchability type", SearchabilityType.BASIC, bean.getSearchabilityType());
+ }
+
+ public void testSetUnsigned() {
+ Boolean unsigned = Boolean.TRUE;
+ // set
+ bean.setUnsigned(unsigned);
+ // check
+ assertSame("Unable to set unsigned", unsigned, bean.isUnsigned());
+ }
+
+ public void testSetAutoIncrement() {
+ Boolean autoIncrement = Boolean.TRUE;
+ // set
+ bean.setAutoIncrement(autoIncrement);
+ // check
+ assertSame("Unable to set auto increment", autoIncrement, bean.isAutoIncrement());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/StoredProcedureBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.ForeignKeyColumn;
+import org.jboss.dna.common.jdbc.model.api.Parameter;
+import org.jboss.dna.common.jdbc.model.api.StoredProcedure;
+import org.jboss.dna.common.jdbc.model.api.StoredProcedureResultType;
+
+/**
+ * StoredProcedureBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class StoredProcedureBeanTest extends TestCase {
+
+ private StoredProcedure bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new StoredProcedureBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetResultType() {
+ // set
+ bean.setResultType(StoredProcedureResultType.RETURNS_RESULT);
+ // check
+ assertSame("Unable to set result type", StoredProcedureResultType.RETURNS_RESULT, bean.getResultType());
+ }
+
+ public void testGetParameters() {
+ Set<Parameter> parameters = bean.getParameters();
+ // check
+ assertNotNull("Unable to get parameters", parameters);
+ assertTrue("Parameter set should be empty by default", parameters.isEmpty());
+ }
+
+ public void testAddParameter() {
+ String PARAMETER_NAME = "My parameter";
+ // create parameter
+ Parameter parameter = new DefaultModelFactory().createParameter();
+ // set name
+ parameter.setName(PARAMETER_NAME);
+ // add
+ bean.addParameter(parameter);
+ // check
+ assertFalse("Parameter set should not be empty", bean.getParameters().isEmpty());
+ }
+
+ public void testDeleteParameter() {
+ String PARAMETER_NAME = "My parameter";
+ // create parameter
+ Parameter parameter = new DefaultModelFactory().createParameter();
+ // set name
+ parameter.setName(PARAMETER_NAME);
+ // add
+ bean.addParameter(parameter);
+ // check
+ assertFalse("Parameter set should not be empty", bean.getParameters().isEmpty());
+
+ // delete
+ bean.deleteParameter(parameter);
+ // check
+ assertTrue("Parameter set should be empty", bean.getParameters().isEmpty());
+ }
+
+ public void testFindParameterByName() {
+ String PARAMETER_NAME = "My parameter";
+ // create parameter
+ Parameter parameter = new DefaultModelFactory().createParameter();
+ // set name
+ parameter.setName(PARAMETER_NAME);
+ // add
+ bean.addParameter(parameter);
+ // check
+ assertSame("Unable to find parameter", parameter, bean.findParameterByName(PARAMETER_NAME));
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,435 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import java.util.HashSet;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.ModelFactory;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifier;
+import org.jboss.dna.common.jdbc.model.api.BestRowIdentifierScopeType;
+import org.jboss.dna.common.jdbc.model.api.Catalog;
+import org.jboss.dna.common.jdbc.model.api.ForeignKey;
+import org.jboss.dna.common.jdbc.model.api.Index;
+import org.jboss.dna.common.jdbc.model.api.Parameter;
+import org.jboss.dna.common.jdbc.model.api.PrimaryKey;
+import org.jboss.dna.common.jdbc.model.api.Privilege;
+import org.jboss.dna.common.jdbc.model.api.Schema;
+import org.jboss.dna.common.jdbc.model.api.Table;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+import org.jboss.dna.common.jdbc.model.api.TableType;
+import org.jboss.dna.common.jdbc.model.spi.TableBean;
+
+/**
+ * TableBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class TableBeanTest extends TestCase {
+
+ private Table bean;
+ private ModelFactory factory;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new TableBean();
+ factory = new DefaultModelFactory();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+ factory = null;
+ super.tearDown();
+ }
+
+ public void testSetTableType() {
+ TableType tableType = factory.createTableType();
+ // set
+ bean.setTableType(tableType);
+
+ // check
+ assertSame("Unable to set table type", tableType, bean.getTableType());
+ }
+
+ public void testSetTypeCatalog() {
+ Catalog typeCatalog = factory.createCatalog();
+ // set
+ bean.setTypeCatalog(typeCatalog);
+ // check
+ assertSame("Unable to set type catalog", typeCatalog, bean.getTypeCatalog());
+ }
+
+ public void testSetTypeSchema() {
+ Schema typeSchema = factory.createSchema();
+ // set
+ bean.setTypeSchema(typeSchema);
+ // check
+ assertSame("Unable to set type schema", typeSchema, bean.getTypeSchema());
+ }
+
+ public void testSetTypeName() {
+ String typeName = "My type";
+ // set
+ bean.setTypeName(typeName);
+ // check
+ assertSame("Unable to set type name", typeName, bean.getTypeName());
+ }
+
+ public void testSetSelfReferencingColumnName() {
+ String selfReferencingColumnName = "Self-Ref column name";
+ // set
+ bean.setSelfReferencingColumnName(selfReferencingColumnName);
+ // check
+ assertSame("Unable to set self referencing column name", selfReferencingColumnName, bean.getSelfReferencingColumnName());
+ }
+
+ public void testSetReferenceGeneration() {
+ String referenceGeneration = "Reference generation";
+ // set
+ bean.setReferenceGeneration(referenceGeneration);
+ // check
+ assertSame("Unable to set reference generation", referenceGeneration, bean.getReferenceGeneration());
+ }
+
+ public void testGetColumns() {
+ Set<TableColumn> columns = bean.getColumns();
+ // check
+ assertNotNull("Unable to get columns", columns);
+ assertTrue("Column set should be empty by default", columns.isEmpty());
+ }
+
+ public void testAddColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testDeleteColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getColumns().isEmpty());
+
+ // delete
+ bean.deleteColumn(column);
+ // check
+ assertTrue("Parameter set should be empty", bean.getColumns().isEmpty());
+ }
+
+ public void testFindColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getColumns().isEmpty());
+ // check
+ assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
+ }
+
+ public void testSetPrimaryKey() {
+ PrimaryKey primaryKey = factory.createPrimaryKey();
+ // set
+ bean.setPrimaryKey(primaryKey);
+ // check
+ assertSame("Unable to set primary key", primaryKey, bean.getPrimaryKey());
+ }
+
+ public void testGetForeignKeys() {
+ Set<ForeignKey> foreignKeys = bean.getForeignKeys();
+ // check
+ assertNotNull("Unable to get FK list", foreignKeys);
+ assertTrue("FK set should be empty by default", foreignKeys.isEmpty());
+ }
+
+ public void testAddForeignKey() {
+ String NAME = "My FK";
+ // create FK
+ ForeignKey fk = factory.createForeignKey();
+ // set name
+ fk.setName(NAME);
+ // add
+ bean.addForeignKey(fk);
+ // check
+ assertFalse("FK set should not be empty", bean.getForeignKeys().isEmpty());
+ }
+
+ public void testDeleteForeignKey() {
+ String NAME = "My FK";
+ // create FK
+ ForeignKey fk = factory.createForeignKey();
+ // set name
+ fk.setName(NAME);
+ // add
+ bean.addForeignKey(fk);
+ // check
+ assertFalse("FK set should not be empty", bean.getForeignKeys().isEmpty());
+
+ // delete
+ bean.deleteForeignKey(fk);
+ // check
+ assertTrue("FK set should be empty", bean.getForeignKeys().isEmpty());
+ }
+
+ public void testFindForeignKeyByName() {
+ String NAME = "My FK";
+ // create FK
+ ForeignKey fk = factory.createForeignKey();
+ // set name
+ fk.setName(NAME);
+ // add
+ bean.addForeignKey(fk);
+ // check
+ assertFalse("FK set should not be empty", bean.getForeignKeys().isEmpty());
+ // check
+ assertSame("Unable to find FK", fk, bean.findForeignKeyByName(NAME));
+ }
+
+ public void testGetIndexes() {
+ Set<Index> indexes = bean.getIndexes();
+ // check
+ assertNotNull("Unable to get Indexes", indexes);
+ assertTrue("Index set should be empty by default", indexes.isEmpty());
+ }
+
+ public void testAddIndex() {
+ String NAME = "My Index";
+ // create FK
+ Index i = factory.createIndex();
+ // set name
+ i.setName(NAME);
+ // add
+ bean.addIndex(i);
+ // check
+ assertFalse("Index set should not be empty", bean.getIndexes().isEmpty());
+ }
+
+ public void testDeleteIndex() {
+ String NAME = "My Index";
+ // create FK
+ Index i = factory.createIndex();
+ // set name
+ i.setName(NAME);
+ // add
+ bean.addIndex(i);
+ // check
+ assertFalse("Index set should not be empty", bean.getIndexes().isEmpty());
+
+ // delete
+ bean.deleteIndex(i);
+ // check
+ assertTrue("*Index set should be empty", bean.getIndexes().isEmpty());
+ }
+
+ public void testFindIndexByName() {
+ String NAME = "My Index";
+ // create FK
+ Index i = factory.createIndex();
+ // set name
+ i.setName(NAME);
+ // add
+ bean.addIndex(i);
+ // check
+ assertFalse("Index set should not be empty", bean.getIndexes().isEmpty());
+ // check
+ assertSame("Unable to find Index", i, bean.findIndexByName(NAME));
+ }
+
+ public void testGetVersionColumns() {
+ Set<TableColumn> columns = bean.getVersionColumns();
+ // check
+ assertNotNull("Unable to get version columns", columns);
+ assertTrue("Version column set should be empty by default", columns.isEmpty());
+ }
+
+ public void testAddVersionColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addVersionColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getVersionColumns().isEmpty());
+ }
+
+ public void testDeleteVersionColumn() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addVersionColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getVersionColumns().isEmpty());
+
+ // delete
+ bean.deleteVersionColumn(column);
+ // check
+ assertTrue("Version Column set should be empty", bean.getVersionColumns().isEmpty());
+ }
+
+ public void testFindVersionColumnByName() {
+ String COLUMN_NAME = "My column";
+ // create column
+ TableColumn column = factory.createTableColumn();
+ // set name
+ column.setName(COLUMN_NAME);
+ // add
+ bean.addVersionColumn(column);
+ // check
+ assertFalse("column set should not be empty", bean.getVersionColumns().isEmpty());
+ // check
+ assertSame("Unable to find column", column, bean.findVersionColumnByName(COLUMN_NAME));
+ }
+
+ public void testGetPrivileges() {
+ Set<Privilege> privileges = bean.getPrivileges();
+ // check
+ assertNotNull("Unable to get privileges", privileges);
+ assertTrue("Privilege set should be empty by default", privileges.isEmpty());
+ }
+
+ public void testAddPrivilege() {
+ String NAME = "My privilege";
+ // create privilege
+ Privilege privilege = factory.createPrivilege();
+ // set name
+ privilege.setName(NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertFalse("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+ }
+
+ public void testDeletePrivilege() {
+ String NAME = "My privilege";
+ // create privilege
+ Privilege privilege = factory.createPrivilege();
+ // set name
+ privilege.setName(NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertFalse("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+ // delete
+ bean.deletePrivilege(privilege);
+ // check
+ assertTrue("Privilege set should be empty", bean.getPrivileges().isEmpty());
+ }
+
+ public void testFindPriviledgeByName() {
+ String NAME = "My privilege";
+ // create privilege
+ Privilege privilege = factory.createPrivilege();
+ // set name
+ privilege.setName(NAME);
+ // add
+ bean.addPrivilege(privilege);
+ // check
+ assertFalse("Privilege set should not be empty", bean.getPrivileges().isEmpty());
+ // check
+ assertSame("Unable to find privilege", privilege, bean.findPriviledgeByName(NAME));
+ }
+
+ public void testGetBestRowIdentifiers() {
+ Set<BestRowIdentifier> bris = bean.getBestRowIdentifiers();
+ // check
+ assertNotNull("Unable to get BestRowIdentifiers", bris);
+ assertTrue("BestRowIdentifier set should be empty by default", bris.isEmpty());
+ }
+
+ public void testAddBestRowIdentifier() {
+ // create
+ BestRowIdentifier id = factory.createBestRowIdentifier();
+ // set scope
+ id.setScopeType(BestRowIdentifierScopeType.SESSION);
+ // add
+ bean.addBestRowIdentifier(id);
+ // check
+ assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
+ }
+
+ public void testDeleteBestRowIdentifier() {
+ // create privilege
+ BestRowIdentifier id = factory.createBestRowIdentifier();
+ // set scope
+ id.setScopeType(BestRowIdentifierScopeType.SESSION);
+ // add
+ bean.addBestRowIdentifier(id);
+ // check
+ assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
+ // delete
+ bean.deleteBestRowIdentifier(id);
+ // check
+ assertTrue("BestRowIdentifier set should be empty", bean.getBestRowIdentifiers().isEmpty());
+ }
+
+ public void testFindBestRowIdentifierByScopeType() {
+ // create privilege
+ BestRowIdentifier id = factory.createBestRowIdentifier();
+ // set scope
+ id.setScopeType(BestRowIdentifierScopeType.SESSION);
+ // add
+ bean.addBestRowIdentifier(id);
+ // check
+ assertFalse("BestRowIdentifier set should not be empty", bean.getBestRowIdentifiers().isEmpty());
+ // check
+ assertSame("Unable to find BestRowIdentifier",
+ id,
+ bean.findBestRowIdentifierByScopeType(BestRowIdentifierScopeType.SESSION));
+ }
+
+ public void testSetSuperTable() {
+ Table superTable = factory.createTable();
+ // set
+ bean.setSuperTable(superTable);
+ // check
+ assertSame("Unable to set super table", superTable, bean.getSuperTable());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableColumnBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.api.ColumnPseudoType;
+import org.jboss.dna.common.jdbc.model.api.TableColumn;
+import org.jboss.dna.common.jdbc.model.api.Reference;
+
+/**
+ * TableColumnBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class TableColumnBeanTest extends TestCase {
+
+ private TableColumn bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new TableColumnBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+ super.tearDown();
+ }
+
+ public void testSetBestRowIdentifier() {
+ // set
+ bean.setBestRowIdentifier(Boolean.TRUE);
+ // check
+ assertSame("Unable to set BestRowIdentifier", Boolean.TRUE, bean.isBestRowIdentifier());
+ }
+
+ public void testSetPseudoType() {
+ // set
+ bean.setPseudoType(ColumnPseudoType.NOT_PSEUDO);
+ // check
+ assertSame("Unable to set column pseudo type", ColumnPseudoType.NOT_PSEUDO, bean.getPseudoType());
+ }
+
+ public void testSetReference() {
+ Reference reference = new DefaultModelFactory().createReference();
+ // set
+ bean.setReference(reference);
+ // check
+ assertSame("Unable to set reference", reference, bean.getReference());
+ }
+
+ public void testSetVersionColumn() {
+ // set
+ bean.setVersionColumn(Boolean.TRUE);
+ // check
+ assertSame("Unable to set VersionColumn", Boolean.TRUE, bean.isVersionColumn());
+ }
+
+ public void testSetPrimaryKeyColumn() {
+ // set
+ bean.setPrimaryKeyColumn(Boolean.TRUE);
+ // check
+ assertSame("Unable to set PrimaryKeyColumn", Boolean.TRUE, bean.isPrimaryKeyColumn());
+ }
+
+ public void testSetForeignKeyColumn() {
+ // set
+ bean.setForeignKeyColumn(Boolean.TRUE);
+ // check
+ assertSame("Unable to set ForeignKeyColumn", Boolean.TRUE, bean.isForeignKeyColumn());
+ }
+
+ public void testSetIndexColumn() {
+ // set
+ bean.setIndexColumn(Boolean.TRUE);
+ // check
+ assertSame("Unable to set IndexColumn", Boolean.TRUE, bean.isIndexColumn());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/TableTypeBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import org.jboss.dna.common.jdbc.model.api.TableType;
+
+/**
+ * TableTypeBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class TableTypeBeanTest extends TestCase {
+
+ private TableType bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new TableTypeBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+ super.tearDown();
+ }
+
+ public void testSetName() {
+ String tableTypeName = "My type name";
+ // set
+ bean.setName(tableTypeName);
+ // check
+ assertSame("Unable to set table type name", tableTypeName, bean.getName());
+ }
+
+ /*
+ * Class under test for Boolean isTable()
+ */
+ public void testIsTable() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_TABLE);
+ // check
+ assertTrue("Unable to set table type to table", bean.isTable());
+ }
+
+ /*
+ * Class under test for Boolean isView()
+ */
+ public void testIsView() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_VIEW);
+ // check
+ assertTrue("Unable to set table type to view", bean.isView());
+ }
+
+ /*
+ * Class under test for Boolean isSystemTable()
+ */
+ public void testIsSystemTable() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_SYS_TABLE);
+ // check
+ assertTrue("Unable to set table type to system table", bean.isSystemTable());
+ }
+
+ /*
+ * Class under test for Boolean isGlobalTemporary()
+ */
+ public void testIsGlobalTemporary() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_GLOBAL_TEMP);
+ // check
+ assertTrue("Unable to set table type to global temporary", bean.isGlobalTemporary());
+ }
+
+ public void testIsLocalTemporary() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_LOCAL_TEMP);
+ // check
+ assertTrue("Unable to set table type to local temporary", bean.isLocalTemporary());
+ }
+
+ /*
+ * Class under test for Boolean isAlias()
+ */
+ public void testIsAlias() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_ALIAS);
+ // check
+ assertTrue("Unable to set table type to alias", bean.isAlias());
+ }
+
+ /*
+ * Class under test for Boolean isSynonym()
+ */
+ public void testIsSynonym() {
+ // set
+ bean.setName(TableType.DEF_TABLE_TYPE_SYNONYM);
+ // check
+ assertTrue("Unable to set table type to synonym", bean.isSynonym());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBeanTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBeanTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/model/spi/UserDefinedTypeBeanTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.model.spi;
+
+import junit.framework.TestCase;
+import java.util.Set;
+import org.jboss.dna.common.jdbc.model.api.Attribute;
+import org.jboss.dna.common.jdbc.model.api.UserDefinedType;
+import org.jboss.dna.common.jdbc.model.api.SqlType;
+import org.jboss.dna.common.jdbc.model.DefaultModelFactory;
+import org.jboss.dna.common.jdbc.model.spi.UserDefinedTypeBean;
+
+/**
+ * UserDefinedTypeBean test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class UserDefinedTypeBeanTest extends TestCase {
+
+ private UserDefinedType bean;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ // create
+ bean = new UserDefinedTypeBean();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ // release
+ bean = null;
+
+ super.tearDown();
+ }
+
+ public void testSetClassName() {
+ String className = "My class";
+ // set
+ bean.setClassName(className);
+ // check
+ assertSame("Unable to set class name", className, bean.getClassName());
+ }
+
+ public void testSetSqlType() {
+ // set
+ bean.setSqlType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set SQL type", SqlType.VARCHAR, bean.getSqlType());
+ }
+
+ public void testSetBaseType() {
+ // set
+ bean.setBaseType(SqlType.VARCHAR);
+ // check
+ assertSame("Unable to set base type", SqlType.VARCHAR, bean.getBaseType());
+ }
+
+ public void testGetAttributes() {
+ Set<Attribute> attributes = bean.getAttributes();
+ // check
+ assertNotNull("Unable to get attributes", attributes);
+ assertTrue("Attribute set should be empty by default", attributes.isEmpty());
+ }
+
+ public void testAddAttribute() {
+ String NAME = "My name";
+ Attribute a = new DefaultModelFactory().createAttribute();
+ // set name
+ a.setName(NAME);
+ // add
+ bean.addAttribute(a);
+ // check
+ assertFalse("Attribute set should not be empty", bean.getAttributes().isEmpty());
+ }
+
+ public void testDeleteAttribute() {
+ String NAME = "My name";
+ Attribute a = new DefaultModelFactory().createAttribute();
+ // set name
+ a.setName(NAME);
+ // add
+ bean.addAttribute(a);
+ // check
+ assertFalse("Attribute set should not be empty", bean.getAttributes().isEmpty());
+ // delete
+ bean.deleteAttribute(a);
+ // check
+ assertTrue("Attribute set should be empty", bean.getAttributes().isEmpty());
+ }
+
+ public void testFindAttributeByName() {
+ String NAME = "My name";
+ Attribute a = new DefaultModelFactory().createAttribute();
+ // set name
+ a.setName(NAME);
+ // add
+ bean.addAttribute(a);
+ // check
+ assertSame("Unable to find attribute", a, bean.findAttributeByName(NAME));
+ }
+
+ public void testSetSuperType() {
+ UserDefinedType st = new DefaultModelFactory().createUserDefinedType();
+ // set
+ bean.setSuperType(st);
+ // check
+ assertSame("Unable to set super type", st, bean.getSuperType());
+ }
+
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProviderTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProviderTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DataSourceDatabaseMetadataProviderTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,243 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import junit.framework.TestCase;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.util.Properties;
+import javax.sql.DataSource;
+
+/**
+ * Data Source Database Metadata Provider Test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DataSourceDatabaseMetadataProviderTest extends TestCase {
+ // ~ Static fields/initializers -------------------------------------------------------
+
+ private static final String PROVIDER_NAME = "TestProvider";
+ private static final String DATA_SOURCE_NAME = "java:comp/env/jdbc/TestDataSource";
+ private static final String INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
+ private static final String PROVIDER_URL = "jnp://localhost:1099/";
+ private final static String EMPTY_STRING_NOTATION = "<EMPTY>";
+ private final static String NULL_STRING_NOTATION = "<NULL>";
+
+ // ~ Instance fields ------------------------------------------------------------------
+
+ private DataSourceDatabaseMetadataProvider dataSourceProvider;
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /*
+ * @see TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // create provider
+ dataSourceProvider = new DefaultDataSourceDatabaseMetadataProvider();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ // release
+ dataSourceProvider = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test get data source
+ * @throws Exception
+ *
+ */
+ public void testGetDataSource() throws Exception {
+ // set provider name
+ dataSourceProvider.setName(PROVIDER_NAME);
+
+ // set data source name
+ dataSourceProvider.setDataSourceName(DATA_SOURCE_NAME);
+
+ // create properties
+ Properties properties = new Properties();
+
+ // set initial context factory
+ properties.put("java.naming.factory.initial", INITIAL_CONTEXT_FACTORY);
+
+ // set provider URL
+ properties.put("java.naming.provider.url", PROVIDER_URL);
+
+ // trying to set properties
+ dataSourceProvider.setProperties(properties);
+
+ // TODO: validate the testGetDataSource
+ try {
+ // trying to get data source
+ DataSource dataSource = dataSourceProvider.getDataSource();
+ fail("DataSource provider should raise an exception when app server is not running");
+ } catch (Exception e) {
+ // we're should be here because app server is not running so far
+ }
+ }
+
+ /**
+ * test set data source name
+ */
+ public void testSetDataSourceName() {
+ // set data source name
+ dataSourceProvider.setDataSourceName(DATA_SOURCE_NAME);
+
+ // check that we really set the name
+ assertEquals("Unable to set the data source name", DATA_SOURCE_NAME, dataSourceProvider.getDataSourceName());
+ }
+
+ /**
+ * test release resources
+ */
+ public void testRelease() {
+ dataSourceProvider.release(true);
+ }
+
+ /**
+ * test get database meta data
+ */
+ public void testGetDatabaseMetaData() {
+ // set provider name
+ dataSourceProvider.setName(PROVIDER_NAME);
+
+ // set data source name
+ dataSourceProvider.setDataSourceName(DATA_SOURCE_NAME);
+
+ // create properties
+ Properties properties = new Properties();
+
+ // set initial context factory
+ properties.put("java.naming.factory.initial", INITIAL_CONTEXT_FACTORY);
+
+ // set provider URL
+ properties.put("java.naming.provider.url", PROVIDER_URL);
+
+ // trying to set properties
+ dataSourceProvider.setProperties(properties);
+
+ // TODO: validate the testGetDatabaseMetaData
+ try {
+ // trying to get connection
+ DatabaseMetaData databaseMetaData = dataSourceProvider.getDatabaseMetaData();
+ fail("DataSource provider should raise an exception when app server is not running");
+ } catch (Exception e) {
+ // we're should be here because app server is not running so far
+ }
+ }
+
+ /**
+ * Test get connection
+ *
+ * @throws Exception
+ */
+ public void testGetConnection() throws Exception {
+ // set provider name
+ dataSourceProvider.setName(PROVIDER_NAME);
+
+ // set data source name
+ dataSourceProvider.setDataSourceName(DATA_SOURCE_NAME);
+
+ // create properties
+ Properties properties = new Properties();
+
+ // set initial context factory
+ properties.put("java.naming.factory.initial", INITIAL_CONTEXT_FACTORY);
+
+ // set provider URL
+ properties.put("java.naming.provider.url", PROVIDER_URL);
+
+ // trying to set properties
+ dataSourceProvider.setProperties(properties);
+
+ // TODO: validate the testGetConnection
+ try {
+ // trying to get connection
+ Connection connection = dataSourceProvider.getConnection();
+ fail("DataSource provider should raise an exception when app server is not running");
+ } catch (Exception e) {
+ // we're should be here because app server is not running so far
+ }
+ }
+
+ /**
+ * Test set name
+ */
+ public void testSetName() {
+ // set provider name
+ dataSourceProvider.setName(PROVIDER_NAME);
+
+ // check that we really set the name
+ assertEquals("Unable to set the data source provider name", PROVIDER_NAME, dataSourceProvider.getName());
+ }
+
+ /**
+ * Test set properties
+ */
+ public void testSetProperties() {
+ // create properties
+ Properties properties = new Properties();
+
+ // set initial context factory
+ properties.put("java.naming.factory.initial", INITIAL_CONTEXT_FACTORY);
+
+ // set provider URL
+ properties.put("java.naming.provider.url", PROVIDER_URL);
+
+ // trying to set properties
+ dataSourceProvider.setProperties(properties);
+
+ // check that we're really set the properties
+ assertSame("Unable to set the data source provider properties", properties, dataSourceProvider.getProperties());
+ }
+
+ /**
+ * Test set string notation
+ */
+ public void testSetEmptyStringNotation() {
+ // trying to set empty string notation
+ dataSourceProvider.setEmptyStringNotation(EMPTY_STRING_NOTATION);
+
+ // check that we're really set the empty string notation
+ assertSame("Unable to set the empty string notation", EMPTY_STRING_NOTATION, dataSourceProvider.getEmptyStringNotation());
+ }
+
+ /**
+ * Test set null string notation
+ */
+ public void testSetNullStringNotation() {
+ // trying to set NULL string notation
+ dataSourceProvider.setNullStringNotation(NULL_STRING_NOTATION);
+
+ // check that we're really set the empty string notation
+ assertSame("Unable to set the NULL string notation", NULL_STRING_NOTATION, dataSourceProvider.getNullStringNotation());
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProviderTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProviderTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/provider/DriverDatabaseMetadataProviderTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,243 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.provider;
+
+import junit.framework.TestCase;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.util.Properties;
+
+/**
+ * Driver Database Metadata Provider Test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DriverDatabaseMetadataProviderTest extends TestCase {
+ // ~ Static fields/initializers -------------------------------------------------------
+
+ private static final String PROVIDER_NAME = "TestProvider";
+ private final static String DRIVER_CLASS_NAME = "org.hsqldb.jdbcDriver";
+ private final static String DATABASE_URL = "jdbc:hsqldb:mem:test";
+ private final static String USER_NAME = "sa";
+ private final static String PASSWORD = "";
+ private final static String EMPTY_STRING_NOTATION = "<EMPTY>";
+ private final static String NULL_STRING_NOTATION = "<NULL>";
+
+ // ~ Instance fields ------------------------------------------------------------------
+
+ private DriverDatabaseMetadataProvider driverProvider;
+
+ // ~ Methods --------------------------------------------------------------------------
+
+ /*
+ * @see TestCase#setUp()
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ // create provider
+ driverProvider = new DefaultDriverDatabaseMetadataProvider();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ @Override
+ protected void tearDown() throws Exception {
+ // release
+ driverProvider = null;
+ super.tearDown();
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetDriverClassName() {
+ // set the driver class name
+ driverProvider.setDriverClassName(DRIVER_CLASS_NAME);
+
+ // check that we're really set the driver class name
+ assertEquals("Unable to set the driver class name", DRIVER_CLASS_NAME, driverProvider.getDriverClassName());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetDatabaseUrl() {
+ // set the database URL
+ driverProvider.setDatabaseUrl(DATABASE_URL);
+
+ // check that we're really set the database URL
+ assertEquals("Unable to set the database URL", DATABASE_URL, driverProvider.getDatabaseUrl());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetUserName() {
+ // set the user name
+ driverProvider.setUserName(USER_NAME);
+
+ // check that we're really set the user name
+ assertEquals("Unable to set the user name", USER_NAME, driverProvider.getUserName());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetPassword() {
+ // set the password
+ driverProvider.setPassword(PASSWORD);
+
+ // check that we're really set the password
+ assertEquals("Unable to set the password", PASSWORD, driverProvider.getPassword());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testRelease() {
+ driverProvider.release(true);
+ }
+
+ /**
+ * COMMENT
+ *
+ * @throws Exception COMMENT
+ */
+ public void testGetDatabaseMetaData() throws Exception {
+ // set provider name
+ driverProvider.setName(PROVIDER_NAME);
+
+ // set the driver class name
+ driverProvider.setDriverClassName(DRIVER_CLASS_NAME);
+
+ // set the database URL
+ driverProvider.setDatabaseUrl(DATABASE_URL);
+
+ // set the user name
+ driverProvider.setUserName(USER_NAME);
+
+ // set the password
+ driverProvider.setPassword(PASSWORD);
+
+ // validate the testGetDatabaseMetaData
+ try {
+ // trying to get connection
+ DatabaseMetaData databaseMetaData = driverProvider.getDatabaseMetaData();
+ // check
+ assertNotNull("Database metadata shall be provided", databaseMetaData);
+ // fail ("Driver provider should raise an exception when DB server is not running");
+ // } catch (Exception e) {
+ // we're should be here because DB server is not running so far
+ // }
+ } finally {
+ // release resource
+ driverProvider.release(true);
+ }
+ }
+
+ /**
+ * COMMENT
+ *
+ * @throws Exception COMMENT
+ */
+ public void testGetConnection() throws Exception {
+ // set provider name
+ driverProvider.setName(PROVIDER_NAME);
+
+ // set the driver class name
+ driverProvider.setDriverClassName(DRIVER_CLASS_NAME);
+
+ // set the database URL
+ driverProvider.setDatabaseUrl(DATABASE_URL);
+
+ // set the user name
+ driverProvider.setUserName(USER_NAME);
+
+ // set the password
+ driverProvider.setPassword(PASSWORD);
+
+ // validate the testGetConnection
+ try {
+ // trying to get connection
+ Connection connection = driverProvider.getConnection();
+ assertNotNull("Database connection shall be provided", connection);
+ // fail ("Driver provider should raise an exception when DB server is not running");
+ // } catch (Exception e) {
+ // we're should be here because DB server is not running so far
+ // }
+ } finally {
+ // release resource
+ driverProvider.release(true);
+ }
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetName() {
+ // set provider name
+ driverProvider.setName(PROVIDER_NAME);
+
+ // check that we really set the name
+ assertEquals("Unable to set the driver provider name", PROVIDER_NAME, driverProvider.getName());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetProperties() {
+ // create properties
+ Properties properties = new Properties();
+
+ // trying to set properties
+ driverProvider.setProperties(properties);
+
+ // check that we're really set the properties
+ assertSame("Unable to set the driver provider properties", properties, driverProvider.getProperties());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetEmptyStringNotation() {
+ // trying to set empty string notation
+ driverProvider.setEmptyStringNotation(EMPTY_STRING_NOTATION);
+
+ // check that we're really set the empty string notation
+ assertSame("Unable to set the empty string notation", EMPTY_STRING_NOTATION, driverProvider.getEmptyStringNotation());
+ }
+
+ /**
+ * COMMENT
+ */
+ public void testSetNullStringNotation() {
+ // trying to set NULL string notation
+ driverProvider.setNullStringNotation(NULL_STRING_NOTATION);
+
+ // check that we're really set the empty string notation
+ assertSame("Unable to set the NULL string notation", NULL_STRING_NOTATION, driverProvider.getNullStringNotation());
+ }
+}
Added: trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/util/DatabaseUtilTest.java
===================================================================
--- trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/util/DatabaseUtilTest.java (rev 0)
+++ trunk/extensions/dna-common-jdbc/src/test/java/org/jboss/dna/common/jdbc/util/DatabaseUtilTest.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,528 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.common.jdbc.util;
+
+import junit.framework.TestCase;
+import java.sql.Types;
+import org.jboss.dna.common.jdbc.model.api.*;
+
+/**
+ * DatabaseUtil test
+ *
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class DatabaseUtilTest extends TestCase {
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /*
+ * Class under test for Boolean getBoolean(ResultSet, String)
+ */
+ public void testGetBoolean() throws Exception {
+ // check
+ assertNull("getBoolean(null, 0) should return null", DatabaseUtil.getBoolean(null, 0));
+ // check
+ assertNull("getBoolean(null, 'myColumn') should return null", DatabaseUtil.getBoolean(null, "myColumn"));
+ }
+
+ /*
+ * Class under test for Integer getInteger(ResultSet, String)
+ */
+ public void testGetInteger() throws Exception {
+ // check
+ assertNull("getInteger(null, 0) should return null", DatabaseUtil.getInteger(null, 0));
+ // check
+ assertNull("getInteger(null, 'myColumn') should return null", DatabaseUtil.getInteger(null, "myColumn"));
+ }
+
+ /*
+ * Class under test for Double getDouble(ResultSet, String)
+ */
+ public void testGetDouble() throws Exception {
+ // check
+ assertNull("getDouble(null, 0) should return null", DatabaseUtil.getDouble(null, 0));
+ // check
+ assertNull("getDouble(null, 'myColumn') should return null", DatabaseUtil.getDouble(null, "myColumn"));
+ }
+
+ /*
+ * Class under test for String getString(ResultSet, String)
+ */
+ public void testGetString() throws Exception {
+ // check
+ assertNull("getString(null, 0) should return null", DatabaseUtil.getString(null, 0));
+ // check
+ assertNull("getString(null, 'myColumn') should return null", DatabaseUtil.getString(null, "myColumn"));
+ }
+
+ public void testGetBestRowIdentifierScopeType() {
+ // check
+ assertNull("getBestRowIdentifierScopeType (null) should return null ", DatabaseUtil.getBestRowIdentifierScopeType(null));
+ // check
+ assertSame("getBestRowIdentifierScopeType () should return BestRowIdentifierScopeType.TEMPORARY",
+ BestRowIdentifierScopeType.TEMPORARY,
+ DatabaseUtil.getBestRowIdentifierScopeType(BestRowIdentifierScopeType.TEMPORARY.getScope()));
+ // check
+ assertSame("getBestRowIdentifierScopeType () should return BestRowIdentifierScopeType.TRANSACTION",
+ BestRowIdentifierScopeType.TRANSACTION,
+ DatabaseUtil.getBestRowIdentifierScopeType(BestRowIdentifierScopeType.TRANSACTION.getScope()));
+ // check
+ assertSame("getBestRowIdentifierScopeType () should return BestRowIdentifierScopeType.SESSION",
+ BestRowIdentifierScopeType.SESSION,
+ DatabaseUtil.getBestRowIdentifierScopeType(BestRowIdentifierScopeType.SESSION.getScope()));
+ }
+
+ public void testGetColumnPseudoType() {
+ // check
+ assertNull("getColumnPseudoType (null) should return null ", DatabaseUtil.getColumnPseudoType(null));
+ // check
+ assertSame("getColumnPseudoType () should return ColumnPseudoType.UNKNOWN",
+ ColumnPseudoType.UNKNOWN,
+ DatabaseUtil.getColumnPseudoType(ColumnPseudoType.UNKNOWN.getType()));
+ // check
+ assertSame("getColumnPseudoType () should return ColumnPseudoType.NOT_PSEUDO",
+ ColumnPseudoType.NOT_PSEUDO,
+ DatabaseUtil.getColumnPseudoType(ColumnPseudoType.NOT_PSEUDO.getType()));
+ // check
+ assertSame("getColumnPseudoType () should return ColumnPseudoType.PSEUDO",
+ ColumnPseudoType.PSEUDO,
+ DatabaseUtil.getColumnPseudoType(ColumnPseudoType.PSEUDO.getType()));
+ }
+
+ public void testGetIndexType() {
+ // check
+ assertNull("getIndexType (null) should return null ", DatabaseUtil.getIndexType(null));
+ // check
+ assertSame("getIndexType () should return IndexType.STATISTIC",
+ IndexType.STATISTIC,
+ DatabaseUtil.getIndexType(IndexType.STATISTIC.getType()));
+ // check
+ assertSame("getIndexType () should return IndexType.CLUSTERED",
+ IndexType.CLUSTERED,
+ DatabaseUtil.getIndexType(IndexType.CLUSTERED.getType()));
+ // check
+ assertSame("getIndexType () should return IndexType.HASHED",
+ IndexType.HASHED,
+ DatabaseUtil.getIndexType(IndexType.HASHED.getType()));
+ // check
+ assertSame("getIndexType () should return IndexType.OTHER",
+ IndexType.OTHER,
+ DatabaseUtil.getIndexType(IndexType.OTHER.getType()));
+ }
+
+ public void testGetKeyDeferrabilityType() {
+ // check
+ assertNull("getKeyDeferrabilityType (null) should return null ", DatabaseUtil.getKeyDeferrabilityType(null));
+ // check
+ assertSame("getKeyDeferrabilityType () should return KeyDeferrabilityType.INITIALLY_DEFERRED",
+ KeyDeferrabilityType.INITIALLY_DEFERRED,
+ DatabaseUtil.getKeyDeferrabilityType(KeyDeferrabilityType.INITIALLY_DEFERRED.getDeferrability()));
+ // check
+ assertSame("getKeyDeferrabilityType () should return KeyDeferrabilityType.INTIALLY_IMMEDIATE",
+ KeyDeferrabilityType.INTIALLY_IMMEDIATE,
+ DatabaseUtil.getKeyDeferrabilityType(KeyDeferrabilityType.INTIALLY_IMMEDIATE.getDeferrability()));
+ // check
+ assertSame("getKeyDeferrabilityType () should return KeyDeferrabilityType.NOT_DEFERRABLE",
+ KeyDeferrabilityType.NOT_DEFERRABLE,
+ DatabaseUtil.getKeyDeferrabilityType(KeyDeferrabilityType.NOT_DEFERRABLE.getDeferrability()));
+ }
+
+ public void testGetKeyModifyRuleType() {
+ // check
+ assertNull("getKeyModifyRuleType (null) should return null ", DatabaseUtil.getKeyModifyRuleType(null));
+ // check
+ assertSame("getKeyModifyRuleType () should return KeyModifyRuleType.CASCADE",
+ KeyModifyRuleType.CASCADE,
+ DatabaseUtil.getKeyModifyRuleType(KeyModifyRuleType.CASCADE.getRule()));
+ // check
+ assertSame("getKeyModifyRuleType () should return KeyModifyRuleType.RESTRICT",
+ KeyModifyRuleType.RESTRICT,
+ DatabaseUtil.getKeyModifyRuleType(KeyModifyRuleType.RESTRICT.getRule()));
+ // check
+ assertSame("getKeyModifyRuleType () should return KeyModifyRuleType.SET_NULL",
+ KeyModifyRuleType.SET_NULL,
+ DatabaseUtil.getKeyModifyRuleType(KeyModifyRuleType.SET_NULL.getRule()));
+ // check
+ assertSame("getKeyModifyRuleType () should return KeyModifyRuleType.NO_ACTION",
+ KeyModifyRuleType.NO_ACTION,
+ DatabaseUtil.getKeyModifyRuleType(KeyModifyRuleType.NO_ACTION.getRule()));
+ // check
+ assertSame("getKeyModifyRuleType () should return KeyModifyRuleType.SET_DEFAULT",
+ KeyModifyRuleType.SET_DEFAULT,
+ DatabaseUtil.getKeyModifyRuleType(KeyModifyRuleType.SET_DEFAULT.getRule()));
+ }
+
+ public void testGetNullabilityType() {
+ // check
+ assertNull("getNullabilityType (null) should return null ", DatabaseUtil.getNullabilityType(null));
+ // check
+ assertSame("getNullabilityType () should return NullabilityType.UNKNOWN",
+ NullabilityType.UNKNOWN,
+ DatabaseUtil.getNullabilityType(NullabilityType.UNKNOWN.getNullability()));
+ // check
+ assertSame("getNullabilityType () should return NullabilityType.NO_NULLS",
+ NullabilityType.NO_NULLS,
+ DatabaseUtil.getNullabilityType(NullabilityType.NO_NULLS.getNullability()));
+ // check
+ assertSame("getNullabilityType () should return NullabilityType.NULLABLE",
+ NullabilityType.NULLABLE,
+ DatabaseUtil.getNullabilityType(NullabilityType.NULLABLE.getNullability()));
+ }
+
+ public void testGetParameterIoType() {
+ // check
+ assertNull("getParameterIoType (null) should return null ", DatabaseUtil.getParameterIoType(null));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.UNKNOWN",
+ ParameterIoType.UNKNOWN,
+ DatabaseUtil.getParameterIoType(ParameterIoType.UNKNOWN.getType()));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.IN",
+ ParameterIoType.IN,
+ DatabaseUtil.getParameterIoType(ParameterIoType.IN.getType()));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.IN_OUT",
+ ParameterIoType.IN_OUT,
+ DatabaseUtil.getParameterIoType(ParameterIoType.IN_OUT.getType()));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.OUT",
+ ParameterIoType.OUT,
+ DatabaseUtil.getParameterIoType(ParameterIoType.OUT.getType()));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.RET",
+ ParameterIoType.RET,
+ DatabaseUtil.getParameterIoType(ParameterIoType.RET.getType()));
+ // check
+ assertSame("getParameterIoType () should return ParameterIoType.RESULT",
+ ParameterIoType.RESULT,
+ DatabaseUtil.getParameterIoType(ParameterIoType.RESULT.getType()));
+ }
+
+ public void testGetPrivilegeType() {
+ // check
+ assertNull("getPrivilegeType (null) should return null ", DatabaseUtil.getPrivilegeType(null));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.INSERT",
+ PrivilegeType.INSERT,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.INSERT.getType()));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.SELECT",
+ PrivilegeType.SELECT,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.SELECT.getType()));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.UPDATE",
+ PrivilegeType.UPDATE,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.UPDATE.getType()));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.DELETE",
+ PrivilegeType.DELETE,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.DELETE.getType()));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.REFERENCE",
+ PrivilegeType.REFERENCE,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.REFERENCE.getType()));
+ // check
+ assertSame("getPrivilegeType () should return PrivilegeType.OTHER",
+ PrivilegeType.OTHER,
+ DatabaseUtil.getPrivilegeType(PrivilegeType.OTHER.getType()));
+ }
+
+ public void testGetResultSetConcurrencyType() {
+ // check
+ assertNull("getResultSetConcurrencyType (null) should return null ", DatabaseUtil.getResultSetConcurrencyType(null));
+ // check
+ assertSame("getResultSetConcurrencyType () should return ResultSetConcurrencyType.READ_ONLY",
+ ResultSetConcurrencyType.READ_ONLY,
+ DatabaseUtil.getResultSetConcurrencyType(ResultSetConcurrencyType.READ_ONLY.getConcurrency()));
+ // check
+ assertSame("getResultSetConcurrencyType () should return ResultSetConcurrencyType.UPDATABLE",
+ ResultSetConcurrencyType.UPDATABLE,
+ DatabaseUtil.getResultSetConcurrencyType(ResultSetConcurrencyType.UPDATABLE.getConcurrency()));
+ }
+
+ public void testGetResultSetHoldabilityType() {
+ // check
+ assertNull("getResultSetHoldabilityType (null) should return null ", DatabaseUtil.getResultSetHoldabilityType(null));
+ // check
+ assertSame("getResultSetHoldabilityType () should return ResultSetHoldabilityType.HOLD_CURSORS_OVER_COMMIT",
+ ResultSetHoldabilityType.HOLD_CURSORS_OVER_COMMIT,
+ DatabaseUtil.getResultSetHoldabilityType(ResultSetHoldabilityType.HOLD_CURSORS_OVER_COMMIT.getHoldability()));
+ // check
+ assertSame("getResultSetHoldabilityType () should return ResultSetHoldabilityType.CLOSE_CURSORS_AT_COMMIT",
+ ResultSetHoldabilityType.CLOSE_CURSORS_AT_COMMIT,
+ DatabaseUtil.getResultSetHoldabilityType(ResultSetHoldabilityType.CLOSE_CURSORS_AT_COMMIT.getHoldability()));
+ }
+
+ public void testGetResultSetType() {
+ // check
+ assertNull("getResultSetType (null) should return null ", DatabaseUtil.getResultSetType(null));
+ // check
+ assertSame("getResultSetType () should return ResultSetType.FORWARD_ONLY ",
+ ResultSetType.FORWARD_ONLY,
+ DatabaseUtil.getResultSetType(ResultSetType.FORWARD_ONLY.getType()));
+ // check
+ assertSame("getResultSetType () should return ResultSetType.SCROLL_INSENSITIVE ",
+ ResultSetType.SCROLL_INSENSITIVE,
+ DatabaseUtil.getResultSetType(ResultSetType.SCROLL_INSENSITIVE.getType()));
+ // check
+ assertSame("getResultSetType () should return ResultSetType.SCROLL_SENSITIVE ",
+ ResultSetType.SCROLL_SENSITIVE,
+ DatabaseUtil.getResultSetType(ResultSetType.SCROLL_SENSITIVE.getType()));
+ }
+
+ public void testGetSearchabilityType() {
+ // check
+ assertNull("getSearchabilityType (null) should return null ", DatabaseUtil.getSearchabilityType(null));
+ // check
+ assertSame("getSearchabilityType () should return SearchabilityType.NOT_SUPPORTED ",
+ SearchabilityType.NOT_SUPPORTED,
+ DatabaseUtil.getSearchabilityType(SearchabilityType.NOT_SUPPORTED.getSearchability()));
+ // check
+ assertSame("getSearchabilityType () should return SearchabilityType.WHERE_LIKE ",
+ SearchabilityType.WHERE_LIKE,
+ DatabaseUtil.getSearchabilityType(SearchabilityType.WHERE_LIKE.getSearchability()));
+ // check
+ assertSame("getSearchabilityType () should return SearchabilityType.BASIC ",
+ SearchabilityType.BASIC,
+ DatabaseUtil.getSearchabilityType(SearchabilityType.BASIC.getSearchability()));
+ // check
+ assertSame("getSearchabilityType () should return SearchabilityType.SEARCHABLE ",
+ SearchabilityType.SEARCHABLE,
+ DatabaseUtil.getSearchabilityType(SearchabilityType.SEARCHABLE.getSearchability()));
+ }
+
+ public void testGetSortSequenceType() {
+ // check
+ assertNull("getSortSequenceType (null) should return null ", DatabaseUtil.getSortSequenceType(null));
+ // check
+ assertSame("getSortSequenceType () should return SortSequenceType.ASCENDING ",
+ SortSequenceType.ASCENDING,
+ DatabaseUtil.getSortSequenceType(SortSequenceType.ASCENDING.getType()));
+ // check
+ assertSame("getSortSequenceType () should return SortSequenceType.DESCENDING ",
+ SortSequenceType.DESCENDING,
+ DatabaseUtil.getSortSequenceType(SortSequenceType.DESCENDING.getType()));
+ // check
+ assertSame("getSortSequenceType () should return SortSequenceType.NOT_SUPPORTED ",
+ SortSequenceType.NOT_SUPPORTED,
+ DatabaseUtil.getSortSequenceType(SortSequenceType.NOT_SUPPORTED.getType()));
+ }
+
+ public void testGetSqlStateType() {
+ // check
+ assertNull("getSqlStateType (null) should return null ", DatabaseUtil.getSqlStateType(null));
+ // check
+ assertSame("getSqlStateType () should return SqlStateType.XOPEN ",
+ SQLStateType.XOPEN,
+ DatabaseUtil.getSqlStateType(SQLStateType.XOPEN.getState()));
+ // check
+ assertSame("getSqlStateType () should return SqlStateType.SQL99 ",
+ SQLStateType.SQL99,
+ DatabaseUtil.getSqlStateType(SQLStateType.SQL99.getState()));
+ }
+
+ public void testGetSqlType() {
+ // check
+ assertNull("getSqlType (null) should return null ", DatabaseUtil.getSqlType(null));
+ // check
+ assertSame("getSqlType () should return SqlType.BIT ", SqlType.BIT, DatabaseUtil.getSqlType(SqlType.BIT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.TINYINT ",
+ SqlType.TINYINT,
+ DatabaseUtil.getSqlType(SqlType.TINYINT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.SMALLINT ",
+ SqlType.SMALLINT,
+ DatabaseUtil.getSqlType(SqlType.SMALLINT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.INTEGER ",
+ SqlType.INTEGER,
+ DatabaseUtil.getSqlType(SqlType.INTEGER.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.BIGINT ",
+ SqlType.BIGINT,
+ DatabaseUtil.getSqlType(SqlType.BIGINT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.FLOAT ", SqlType.FLOAT, DatabaseUtil.getSqlType(SqlType.FLOAT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.REAL ", SqlType.REAL, DatabaseUtil.getSqlType(SqlType.REAL.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.DOUBLE ",
+ SqlType.DOUBLE,
+ DatabaseUtil.getSqlType(SqlType.DOUBLE.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.NUMERIC ",
+ SqlType.NUMERIC,
+ DatabaseUtil.getSqlType(SqlType.NUMERIC.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.DECIMAL ",
+ SqlType.DECIMAL,
+ DatabaseUtil.getSqlType(SqlType.DECIMAL.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.CHAR ", SqlType.CHAR, DatabaseUtil.getSqlType(SqlType.CHAR.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.VARCHAR ",
+ SqlType.VARCHAR,
+ DatabaseUtil.getSqlType(SqlType.VARCHAR.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.LONGVARCHAR ",
+ SqlType.LONGVARCHAR,
+ DatabaseUtil.getSqlType(SqlType.LONGVARCHAR.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.DATE ", SqlType.DATE, DatabaseUtil.getSqlType(SqlType.DATE.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.TIME ", SqlType.TIME, DatabaseUtil.getSqlType(SqlType.TIME.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.TIMESTAMP ",
+ SqlType.TIMESTAMP,
+ DatabaseUtil.getSqlType(SqlType.TIMESTAMP.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.BINARY ",
+ SqlType.BINARY,
+ DatabaseUtil.getSqlType(SqlType.BINARY.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.VARBINARY ",
+ SqlType.VARBINARY,
+ DatabaseUtil.getSqlType(SqlType.VARBINARY.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.LONGVARBINARY ",
+ SqlType.LONGVARBINARY,
+ DatabaseUtil.getSqlType(SqlType.LONGVARBINARY.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.NULL ", SqlType.NULL, DatabaseUtil.getSqlType(SqlType.NULL.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.OTHER ", SqlType.OTHER, DatabaseUtil.getSqlType(SqlType.OTHER.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.JAVA_OBJECT ",
+ SqlType.JAVA_OBJECT,
+ DatabaseUtil.getSqlType(SqlType.JAVA_OBJECT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.DISTINCT ",
+ SqlType.DISTINCT,
+ DatabaseUtil.getSqlType(SqlType.DISTINCT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.STRUCT ",
+ SqlType.STRUCT,
+ DatabaseUtil.getSqlType(SqlType.STRUCT.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.ARRAY ", SqlType.ARRAY, DatabaseUtil.getSqlType(SqlType.ARRAY.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.BLOB ", SqlType.BLOB, DatabaseUtil.getSqlType(SqlType.BLOB.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.CLOB ", SqlType.CLOB, DatabaseUtil.getSqlType(SqlType.CLOB.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.REF ", SqlType.REF, DatabaseUtil.getSqlType(SqlType.REF.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.DATALINK ",
+ SqlType.DATALINK,
+ DatabaseUtil.getSqlType(SqlType.DATALINK.getType()));
+ // check
+ assertSame("getSqlType () should return SqlType.BOOLEAN ",
+ SqlType.BOOLEAN,
+ DatabaseUtil.getSqlType(SqlType.BOOLEAN.getType()));
+ }
+
+ public void testGetStoredProcedureResultType() {
+ // check
+ assertNull("getStoredProcedureResultType (null) should return null ", DatabaseUtil.getStoredProcedureResultType(null));
+ // check
+ assertSame("getStoredProcedureResultType () should return StoredProcedureResultType.NO_RESULT ",
+ StoredProcedureResultType.NO_RESULT,
+ DatabaseUtil.getStoredProcedureResultType(StoredProcedureResultType.NO_RESULT.getType()));
+ // check
+ assertSame("getStoredProcedureResultType () should return StoredProcedureResultType.RETURNS_RESULT ",
+ StoredProcedureResultType.RETURNS_RESULT,
+ DatabaseUtil.getStoredProcedureResultType(StoredProcedureResultType.RETURNS_RESULT.getType()));
+ // check
+ assertSame("getStoredProcedureResultType () should return StoredProcedureResultType.UNKNOWN ",
+ StoredProcedureResultType.UNKNOWN,
+ DatabaseUtil.getStoredProcedureResultType(StoredProcedureResultType.UNKNOWN.getType()));
+ }
+
+ public void testGetTransactionIsolationLevelType() {
+ // check
+ assertNull("getTransactionIsolationLevelType (null) should return null ",
+ DatabaseUtil.getTransactionIsolationLevelType(null));
+ // check
+ assertSame("getTransactionIsolationLevelType () should return TransactionIsolationLevelType.NONE",
+ TransactionIsolationLevelType.NONE,
+ DatabaseUtil.getTransactionIsolationLevelType(TransactionIsolationLevelType.NONE.getLevel()));
+ // check
+ assertSame("getTransactionIsolationLevelType () should return TransactionIsolationLevelType.READ_UNCOMMITTED",
+ TransactionIsolationLevelType.READ_UNCOMMITTED,
+ DatabaseUtil.getTransactionIsolationLevelType(TransactionIsolationLevelType.READ_UNCOMMITTED.getLevel()));
+ // check
+ assertSame("getTransactionIsolationLevelType () should return TransactionIsolationLevelType.READ_COMMITTED",
+ TransactionIsolationLevelType.READ_COMMITTED,
+ DatabaseUtil.getTransactionIsolationLevelType(TransactionIsolationLevelType.READ_COMMITTED.getLevel()));
+ // check
+ assertSame("getTransactionIsolationLevelType () should return TransactionIsolationLevelType.REPEATABLE_READ",
+ TransactionIsolationLevelType.REPEATABLE_READ,
+ DatabaseUtil.getTransactionIsolationLevelType(TransactionIsolationLevelType.REPEATABLE_READ.getLevel()));
+ // check
+ assertSame("getTransactionIsolationLevelType () should return TransactionIsolationLevelType.SERIALIZABLE",
+ TransactionIsolationLevelType.SERIALIZABLE,
+ DatabaseUtil.getTransactionIsolationLevelType(TransactionIsolationLevelType.SERIALIZABLE.getLevel()));
+ }
+
+ public void testGetStandardUserDefinedTypes() {
+ // get string array
+ String udtTypes = DatabaseUtil.getStandardUserDefinedTypes();
+ // check not null
+ assertNotNull("DatabaseUtil.getStandardUserDefinedTypes should return not empty list", udtTypes);
+ // check that JAVA_OBJECT present
+ assertTrue("JAVA_OBJECT should be specified among standard UDT", udtTypes.contains("JAVA_OBJECT"));
+ // check that STRUCT present
+ assertTrue("STRUCT should be specified among standard UDT", udtTypes.contains("STRUCT"));
+ // check that DISTINCT present
+ assertTrue("DISTINCT should be specified among standard UDT", udtTypes.contains("DISTINCT"));
+ }
+
+ public void testGetUserDefinedTypes() {
+ // UDT string array
+ String udtTypes = "DISTINCT,JAVA_OBJECT,STRUCT";
+ // get int array
+ int[] udtIntTypes = DatabaseUtil.getUserDefinedTypes(udtTypes);
+ // check not null
+ assertNotNull("UDT int array should be not null", udtIntTypes);
+ // check size
+ assertEquals("The size of UDT int array is expected to be three", 3, udtIntTypes.length);
+ // check first element
+ assertEquals("The udtIntTypes[0] should be equal to Types.DISTINCT", Types.DISTINCT, udtIntTypes[0]);
+ // check second element
+ assertEquals("The udtIntTypes[1] should be equal to Types.JAVA_OBJECT", Types.JAVA_OBJECT, udtIntTypes[1]);
+ // check third element
+ assertEquals("The udtIntTypes[2] should be equal to Types.STRUCT", Types.STRUCT, udtIntTypes[2]);
+ }
+}
Added: trunk/extensions/dna-sequencer-jdbc-metadata/.classpath
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/.classpath (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/.classpath 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: trunk/extensions/dna-sequencer-jdbc-metadata/.project
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/.project (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/.project 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>dna-sequencer-jdbc-metadata</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.eclipse.jdt.core.prefs 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,5 @@
+#Mon Nov 17 21:54:48 EST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/.settings/org.maven.ide.eclipse.prefs 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,8 @@
+#Mon Nov 17 21:54:38 EST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: trunk/extensions/dna-sequencer-jdbc-metadata/pom.xml
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/pom.xml (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/pom.xml 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,53 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>dna</artifactId>
+ <groupId>org.jboss.dna</groupId>
+ <version>0.4-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+ <!-- The groupId and version values are inherited from parent -->
+ <artifactId>dna-sequencer-jdbc-metadata</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss DNA JDBC Metadata Sequencer</name>
+ <description>JBoss DNA Sequencer that processes JDBC metadata</description>
+ <url>http://labs.jboss.org/dna</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-graph</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.dna</groupId>
+ <artifactId>dna-common-jdbc</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <!--
+ Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for testing)
+ -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ <version>4.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/jdbc/JdbcMetadataI18n.java
===================================================================
--- trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/jdbc/JdbcMetadataI18n.java (rev 0)
+++ trunk/extensions/dna-sequencer-jdbc-metadata/src/main/java/org/jboss/dna/sequencer/jdbc/JdbcMetadataI18n.java 2008-11-18 13:00:30 UTC (rev 640)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.jdbc;
+
+import java.util.Locale;
+import java.util.Set;
+import org.jboss.dna.common.i18n.I18n;
+
+/**
+ * I18N
+ * @author <a href="mailto:litsenko_sergey@yahoo.com">Sergiy Litsenko</a>
+ */
+public class JdbcMetadataI18n {
+ public static I18n sequencerTaskName;
+
+ static {
+ try {
+ I18n.initialize(JdbcMetadataI18n.class);
+ } catch (final Exception err) {
+ System.err.println(err);
+ }
+ }
+
+ public static Set<Locale> getLocalizationProblemLocales() {
+ return I18n.getLocalizationProblemLocales(JdbcMetadataI18n.class);
+ }
+
+ public static Set<String> getLocalizationProblems() {
+ return I18n.getLocalizationProblems(JdbcMetadataI18n.class);
+ }
+
+ public static Set<String> getLocalizationProblems( Locale locale ) {
+ return I18n.getLocalizationProblems(JdbcMetadataI18n.class, locale);
+ }
+
+}
17 years, 1 month
DNA SVN: r639 - trunk/docs/gettingstarted/src/main/docbook/en-US/content.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-17 15:48:00 -0500 (Mon, 17 Nov 2008)
New Revision: 639
Modified:
trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
Log:
Corrected section 2.2 of the Getting Started guide
Modified: trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
===================================================================
--- trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-17 20:46:23 UTC (rev 638)
+++ trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-17 20:48:00 UTC (rev 639)
@@ -48,10 +48,10 @@
of other DNA components or third-party systems that support these standard APIs.</para>
<mediaobject>
<imageobject role="fo">
- <imagedata align="center" fileref="images/dna-architecture.png" />
+ <imagedata align="center" fileref="dna-architecture.png" />
</imageobject>
<imageobject role="html">
- <imagedata align="center" fileref="images/dna-architecture.png" />
+ <imagedata align="center" fileref="dna-architecture.png" />
</imageobject>
</mediaobject>
<para>
17 years, 1 month
DNA SVN: r638 - trunk/docs/gettingstarted/src/main/docbook/en-US/content.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-17 15:46:23 -0500 (Mon, 17 Nov 2008)
New Revision: 638
Modified:
trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
Log:
Corrected section 2.2 of the Getting Started guide
Modified: trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
===================================================================
--- trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-17 20:44:38 UTC (rev 637)
+++ trunk/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-17 20:46:23 UTC (rev 638)
@@ -98,8 +98,8 @@
<para>
<emphasis role="strong">DNA WebDAV Server</emphasis>
allows clients such as Microsoft Windows and Apple OS X to connect to, read, and edit the content in the repository
- using the WebDAV standard. Since WebDAV is an extension of HTTP, web browsers are able to read (but not modify) the
- content served by a WebDAV compliant server. The DNA WebDAV Server operates upon any JCR-compliant repository.
+ using the WebDAV standard. WebDAV is an extension of HTTP, so web browsers are able to access the content
+ served by a WebDAV compliant server. The DNA WebDAV Server operates upon any JCR-compliant repository.
</para>
</listitem>
<listitem>
17 years, 1 month
DNA SVN: r637 - tags/dna-0.3/docs/gettingstarted/src/main/docbook/en-US/content.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-17 15:44:38 -0500 (Mon, 17 Nov 2008)
New Revision: 637
Modified:
tags/dna-0.3/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
Log:
Corrected section 2.2 of the Getting Started guide
Modified: tags/dna-0.3/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml
===================================================================
--- tags/dna-0.3/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-14 14:20:34 UTC (rev 636)
+++ tags/dna-0.3/docs/gettingstarted/src/main/docbook/en-US/content/understanding_dna.xml 2008-11-17 20:44:38 UTC (rev 637)
@@ -48,10 +48,10 @@
of other DNA components or third-party systems that support these standard APIs.</para>
<mediaobject>
<imageobject role="fo">
- <imagedata align="center" fileref="images/dna-architecture.png" />
+ <imagedata align="center" fileref="dna-architecture.png" />
</imageobject>
<imageobject role="html">
- <imagedata align="center" fileref="images/dna-architecture.png" />
+ <imagedata align="center" fileref="dna-architecture.png" />
</imageobject>
</mediaobject>
<para>
@@ -98,8 +98,8 @@
<para>
<emphasis role="strong">DNA WebDAV Server</emphasis>
allows clients such as Microsoft Windows and Apple OS X to connect to, read, and edit the content in the repository
- using the WebDAV standard. Since WebDAV is an extension of HTTP, web browsers are able to read (but not modify) the
- content served by a WebDAV compliant server. The DNA WebDAV Server operates upon any JCR-compliant repository.
+ using the WebDAV standard. WebDAV is an extension of HTTP, so web browsers are able to access the content
+ served by a WebDAV compliant server. The DNA WebDAV Server operates upon any JCR-compliant repository.
</para>
</listitem>
<listitem>
17 years, 1 month
DNA SVN: r636 - trunk/docs/reference/src/main/docbook/en-US/content.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-14 09:20:34 -0500 (Fri, 14 Nov 2008)
New Revision: 636
Modified:
trunk/docs/reference/src/main/docbook/en-US/content/development_tools.xml
Log:
Corrected some of the 'release' steps to reflect the current process
Modified: trunk/docs/reference/src/main/docbook/en-US/content/development_tools.xml
===================================================================
--- trunk/docs/reference/src/main/docbook/en-US/content/development_tools.xml 2008-11-14 13:55:27 UTC (rev 635)
+++ trunk/docs/reference/src/main/docbook/en-US/content/development_tools.xml 2008-11-14 14:20:34 UTC (rev 636)
@@ -387,33 +387,49 @@
<programlisting>$ mvn -Passembly release:prepare</programlisting>
<para>
You will again be prompted for the release versions and tag name. These should be the same as what was used during the dry run.
- This will run the same steps as the dry run, with the additional step of tagging the release in SVN.
+ This will run the same steps as the dry run, with the additional step of tagging the release in SVN.
</para>
<para>
- If there are any problems during this step, you should go back and try the dry run option.
+ If there are any problems during this step, you should go back and try the dry run option. But after this runs successfully,
+ the release will be tagged in SVN, and the <code>pom.xml</code> files in SVN under <code>/trunk</code> will have the
+ next version in the "<version>" values.
+ However, the artifacts for the release are not yet published. That's the next step.
</para>
</sect2>
<sect2 id="release">
<title>Perform the release</title>
<para>
- Next run the perform step which will checkout the files from the tag, do a build, and deploy the generated artifacts.
+ At this point, the release's artifacts need to be published to the JBoss Maven repository. This next command check outs the
+ files from the release tag created earlier (into a <code>trunk/target/checkout</code> directory), runs a build, and then
+ deploys the generated artifacts. Note that this ensures that the artifacts are built from the tagged code.
</para>
- <programlisting>$ mvn -Passembly release:perform</programlisting>
+ <programlisting>$ mvn release:perform -DuseReleaseProfile=false</programlisting>
+ <note>
+ <para>
+ If during this process you get an error finding the released artifacts in your local Maven repository, you may
+ need to go into the <code>trunk/target/checkout</code> folder and run <code>$ mvn install</code>. This is a simple
+ workaround to make the artifacts available locally. Another option to try is adding <code>-Dgoals=install,assembly</code>
+ to the <code>$ mvn release:perform... </code> command above.
+ </para>
+ </note>
<para>
- The deployment is done to the local file system (a local checkout of the JBoss Maven2 repository), so you will need to
+ The artifacts are deployed to the local file system, which is comprised of a local checkout of the JBoss Maven2 repository
+ in a location specified by a combination of the <code><distributionManagement></code> section of several <code>pom.xml</code>
+ files and your personal <code>settings.xml</code> file. Once this Maven command completes, you will need to
commit the new files after they are deployed. For more information, see the
<ulink url="http://wiki.jboss.org/wiki/Maven">JBoss wiki</ulink>.
</para>
<para>
- Note that the release process updates your project's <code>pom.xml</code> files to change the "<version>" values
- to the next version. These will then need to be committed onto the trunk of SVN.
- </para>
- <para>
At this point, the software has been released and tagged, and it's been deployed to a local checked-out copy of the
JBoss DNA Maven 2 repository (via the "<distribution>" section of the pom.xml files). Those need to be committed
into the Maven 2 repository using SVN. And finally, the last thing is to publish the release onto
the project's <ulink url="&Downloads;">downloads</ulink> and <ulink url="&Home;/docs">documentation</ulink> pages.
</para>
+ <para>
+ The assemblies of the source, binaries, etc. also need to be published onto the &Downloads; area of the
+ <ulink url="http://www.jboss.org/dna">the project page</ulink>. This process is expected to change, as <ulink url="http://www.jboss.org">JBoss.org</ulink>
+ improves its infrastructure.
+ </para>
</sect2>
</sect1>
<sect1>
17 years, 1 month
DNA SVN: r635 - trunk/docs/presentations.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-14 08:55:27 -0500 (Fri, 14 Nov 2008)
New Revision: 635
Modified:
trunk/docs/presentations/JBoss DNA 2008-10.keynote.zip
trunk/docs/presentations/JBoss DNA 2008-10.pdf
Log:
Minor corrections to presentation
Modified: trunk/docs/presentations/JBoss DNA 2008-10.keynote.zip
===================================================================
(Binary files differ)
Modified: trunk/docs/presentations/JBoss DNA 2008-10.pdf
===================================================================
(Binary files differ)
17 years, 1 month
DNA SVN: r634 - trunk/docs/examples/gettingstarted.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-13 16:54:58 -0500 (Thu, 13 Nov 2008)
New Revision: 634
Modified:
trunk/docs/examples/gettingstarted/pom.xml
Log:
Added missing deployment information to parent pom.xml for examples
Modified: trunk/docs/examples/gettingstarted/pom.xml
===================================================================
--- trunk/docs/examples/gettingstarted/pom.xml 2008-11-13 21:45:26 UTC (rev 633)
+++ trunk/docs/examples/gettingstarted/pom.xml 2008-11-13 21:54:58 UTC (rev 634)
@@ -177,4 +177,35 @@
</plugins>
</build>
+ <repositories>
+ <repository>
+ <id>apiviz.release</id>
+ <name>APIviz releases</name>
+ <url>http://apiviz.googlecode.com/svn/site/repo/mvn/release</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.com/maven2</url>
+ </repository>
+ <repository>
+ <id>jboss-snapshot</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+ <distributionManagement>
+ <repository>
+ <!-- Copy the distribution jar file to a local checkout of the maven repository
+ - This variable can be set in $MAVEN_HOME/conf/settings.xml -->
+ <id>repository.jboss.org</id>
+ <url>file://${jboss.repository.root}</url>
+ </repository>
+ </distributionManagement>
</project>
\ No newline at end of file
17 years, 1 month
DNA SVN: r633 - tags/dna-0.3/docs/examples/gettingstarted.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-13 16:45:26 -0500 (Thu, 13 Nov 2008)
New Revision: 633
Modified:
tags/dna-0.3/docs/examples/gettingstarted/pom.xml
Log:
Added missing deployment information to parent pom.xml for examples
Modified: tags/dna-0.3/docs/examples/gettingstarted/pom.xml
===================================================================
--- tags/dna-0.3/docs/examples/gettingstarted/pom.xml 2008-11-13 21:16:44 UTC (rev 632)
+++ tags/dna-0.3/docs/examples/gettingstarted/pom.xml 2008-11-13 21:45:26 UTC (rev 633)
@@ -176,5 +176,36 @@
</plugin>
</plugins>
</build>
+ <repositories>
+ <repository>
+ <id>apiviz.release</id>
+ <name>APIviz releases</name>
+ <url>http://apiviz.googlecode.com/svn/site/repo/mvn/release</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+
+ <repository>
+ <id>jboss</id>
+ <url>http://repository.jboss.com/maven2</url>
+ </repository>
+ <repository>
+ <id>jboss-snapshot</id>
+ <url>http://snapshots.jboss.org/maven2</url>
+ </repository>
+ </repositories>
+ <distributionManagement>
+ <repository>
+ <!-- Copy the distribution jar file to a local checkout of the maven repository
+ - This variable can be set in $MAVEN_HOME/conf/settings.xml -->
+ <id>repository.jboss.org</id>
+ <url>file://${jboss.repository.root}</url>
+ </repository>
+ </distributionManagement>
</project>
\ No newline at end of file
17 years, 1 month
DNA SVN: r632 - tags/dna-0.3.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-13 16:16:44 -0500 (Thu, 13 Nov 2008)
New Revision: 632
Modified:
tags/dna-0.3/pom.xml
Log:
Cleaned up pom.xml changes from previous steps.
Modified: tags/dna-0.3/pom.xml
===================================================================
--- tags/dna-0.3/pom.xml 2008-11-13 20:48:14 UTC (rev 631)
+++ tags/dna-0.3/pom.xml 2008-11-13 21:16:44 UTC (rev 632)
@@ -352,22 +352,6 @@
</archive>
</configuration>
</plugin>
- <!--
- This section defines an option for the "release:perform" plugin,
- so that additional profiles/goals are run during that stage.
- -->
- <plugin>
- <artifactId>maven-release-plugin</artifactId>
- <!--version>2.0-beta-7</version-->
- <configuration>
- <!--
- During release:perform, enable the "release" profile
- and create the JavaDoc and run an install before the deploy.
- -->
- <releaseProfiles>release</releaseProfiles>
- <goals>javadoc:javadoc install deploy assembly:assembly</goals>
- </configuration>
- </plugin>
</plugins>
</build>
<!--
17 years, 1 month
DNA SVN: r631 - tags/dna-0.3.
by dna-commits@lists.jboss.org
Author: rhauch
Date: 2008-11-13 15:48:14 -0500 (Thu, 13 Nov 2008)
New Revision: 631
Modified:
tags/dna-0.3/pom.xml
Log:
Added option to the pom.xml that controls the profiles and goals during the 'release:perform' step.
Modified: tags/dna-0.3/pom.xml
===================================================================
--- tags/dna-0.3/pom.xml 2008-11-13 20:42:36 UTC (rev 630)
+++ tags/dna-0.3/pom.xml 2008-11-13 20:48:14 UTC (rev 631)
@@ -361,10 +361,10 @@
<!--version>2.0-beta-7</version-->
<configuration>
<!--
- During release:perform, enable the "assembly" profile
+ During release:perform, enable the "release" profile
and create the JavaDoc and run an install before the deploy.
-->
- <releaseProfiles>assembly</releaseProfiles>
+ <releaseProfiles>release</releaseProfiles>
<goals>javadoc:javadoc install deploy assembly:assembly</goals>
</configuration>
</plugin>
17 years, 1 month