Author: medgar
Date: Thu Aug 30 12:24:05 2012
New Revision: 1378906
URL: http://svn.apache.org/viewvc?rev=1378906&view=rev
Log:
CAY-1734: Added NuoDB database support
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbActionBuilder.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbAdapter.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectAction.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectTranslator.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSniffer.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/types.xml
Modified:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/AdapterMapping.java
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/DbAdapterInfo.java
Modified:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java?rev=1378906&r1=1378905&r2=1378906&view=diff
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
(original)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
Thu Aug 30 12:24:05 2012
@@ -42,6 +42,7 @@ import org.apache.cayenne.dba.h2.H2Sniff
import org.apache.cayenne.dba.hsqldb.HSQLDBSniffer;
import org.apache.cayenne.dba.ingres.IngresSniffer;
import org.apache.cayenne.dba.mysql.MySQLSniffer;
+import org.apache.cayenne.dba.nuodb.NuodbSniffer;
import org.apache.cayenne.dba.openbase.OpenBaseSniffer;
import org.apache.cayenne.dba.oracle.OracleSniffer;
import org.apache.cayenne.dba.postgres.PostgresSniffer;
@@ -85,7 +86,8 @@ public class AutoAdapter implements DbAd
new FrontBaseSniffer(),
new IngresSniffer(),
new SQLiteSniffer(),
- new H2Sniffer()));
+ new H2Sniffer(),
+ new NuodbSniffer()));
}
/**
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbActionBuilder.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbActionBuilder.java?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbActionBuilder.java
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbActionBuilder.java
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,42 @@
+/*****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.dba.nuodb;
+
+import org.apache.cayenne.dba.JdbcActionBuilder;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.query.SQLAction;
+import org.apache.cayenne.query.SelectQuery;
+
+/**
+ * @since 1.2
+ */
+class NuodbActionBuilder extends JdbcActionBuilder {
+
+ NuodbActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
+ super(adapter, resolver);
+ }
+
+ @Override
+ public SQLAction objectSelectAction(SelectQuery query) {
+ return new NuodbSelectAction(query, adapter, entityResolver);
+ }
+
+}
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbAdapter.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbAdapter.java?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbAdapter.java
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbAdapter.java
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,147 @@
+/*****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.dba.nuodb;
+
+import java.sql.PreparedStatement;
+import java.sql.Types;
+
+import org.apache.cayenne.access.DataNode;
+import org.apache.cayenne.access.types.BooleanType;
+import org.apache.cayenne.access.types.CharType;
+import org.apache.cayenne.access.types.ExtendedTypeMap;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.map.DbAttribute;
+import org.apache.cayenne.map.DbEntity;
+import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.SQLAction;
+
+/**
+ * @since 3.0
+ */
+public class NuodbAdapter extends JdbcAdapter {
+
+ public NuodbAdapter() {
+ setSupportsGeneratedKeys(true);
+ }
+
+ @Override
+ protected void configureExtendedTypes(ExtendedTypeMap map) {
+ super.configureExtendedTypes(map);
+
+ // configure boolean type to work with numeric columns
+ map.registerType(new NuodbCharType());
+
+ // configure boolean type to work with numeric columns
+ map.registerType(new NuodbBooleanType());
+ }
+
+ /**
+ * Uses special action builder to create the right action.
+ *
+ * @since 1.2
+ */
+ @Override
+ public SQLAction getAction(Query query, DataNode node) {
+ return query.createSQLAction(new NuodbActionBuilder(this,
node.getEntityResolver()));
+ }
+
+ /**
+ * Appends SQL for column creation to CREATE TABLE buffer.
+ *
+ * @since 1.2
+ */
+ @Override
+ public void createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute
column) {
+ super.createTableAppendColumn(sqlBuffer, column);
+
+ if (column.isPrimaryKey()) {
+ sqlBuffer.append(" generated always as identity primary key");
+ }
+ }
+
+ /**
+ * @since 1.2
+ */
+ @Override
+ protected void createTableAppendPKClause(StringBuffer sqlBuffer, DbEntity
entity) {
+ }
+
+ final class NuodbCharType extends CharType {
+
+ NuodbCharType() {
+ super(true, true);
+ }
+
+ @Override
+ public void setJdbcObject(
+ PreparedStatement st,
+ Object value,
+ int pos,
+ int type,
+ int scale) throws Exception {
+
+ if (value == null) {
+ st.setNull(pos, type);
+ }
+ else if (type == Types.CLOB) {
+ st.setString(pos, (String) value);
+ }
+ else if (type == Types.BIGINT) {
+ st.setLong(pos, Long.parseLong(value.toString()));
+ }
+ else if (type == Types.INTEGER) {
+ st.setInt(pos, Integer.parseInt(value.toString()));
+ }
+ else if (scale != -1) {
+ st.setObject(pos, value, type, scale);
+ }
+ else {
+ st.setObject(pos, value, type);
+ }
+ }
+ }
+
+ final class NuodbBooleanType extends BooleanType {
+
+ @Override
+ public void setJdbcObject(
+ PreparedStatement st,
+ Object val,
+ int pos,
+ int type,
+ int precision) throws Exception {
+
+ if (val == null) {
+ st.setNull(pos, type);
+ }
+ else if (type == Types.BIT || type == Types.BOOLEAN) {
+ boolean flag = Boolean.TRUE.equals(val);
+ st.setBoolean(pos, flag);
+ }
+ else if (type == Types.INTEGER) {
+ int intVal = Boolean.TRUE.equals(val) ? 1 : 0;
+ st.setInt(pos, intVal);
+ }
+ else {
+ st.setObject(pos, val, type);
+ }
+ }
+ }
+}
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectAction.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectAction.java?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectAction.java
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectAction.java
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,53 @@
+/*****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ****************************************************************/
+package org.apache.cayenne.dba.nuodb;
+
+import java.sql.Connection;
+
+import org.apache.cayenne.access.jdbc.SelectAction;
+import org.apache.cayenne.access.trans.SelectTranslator;
+import org.apache.cayenne.dba.JdbcAdapter;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.query.SelectQuery;
+
+/**
+ * @since 3.0
+ */
+class NuodbSelectAction extends SelectAction {
+
+ NuodbSelectAction(SelectQuery query, JdbcAdapter adapter,
+ EntityResolver entityResolver) {
+ super(query, adapter, entityResolver);
+ }
+
+ @Override
+ protected int getInMemoryOffset(int queryOffset) {
+ return 0;
+ }
+
+ @Override
+ protected SelectTranslator createTranslator(Connection connection) {
+ SelectTranslator translator = new NuodbSelectTranslator();
+ translator.setQuery(query);
+ translator.setAdapter(adapter);
+ translator.setEntityResolver(getEntityResolver());
+ translator.setConnection(connection);
+ return translator;
+ }
+}
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectTranslator.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectTranslator.java?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectTranslator.java
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSelectTranslator.java
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,41 @@
+/*****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.dba.nuodb;
+
+import org.apache.cayenne.access.trans.SelectTranslator;
+
+/**
+ * @since 1.2
+ */
+class NuodbSelectTranslator extends SelectTranslator {
+
+ @Override
+ protected void appendLimitAndOffsetClauses(StringBuilder buffer) {
+ int offset = queryMetadata.getFetchOffset();
+ if (offset > 0) {
+ buffer.append(" OFFSET ").append(offset);
+ }
+
+ int limit = queryMetadata.getFetchLimit();
+ if (limit > 0) {
+ buffer.append(" FETCH ").append(limit);
+ }
+ }
+}
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSniffer.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSniffer.java?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSniffer.java
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/nuodb/NuodbSniffer.java
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,40 @@
+/*****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ****************************************************************/
+
+package org.apache.cayenne.dba.nuodb;
+
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+
+import org.apache.cayenne.dba.DbAdapter;
+import org.apache.cayenne.dba.DbAdapterFactory;
+
+/**
+ * @since 3.0
+ */
+public class NuodbSniffer implements DbAdapterFactory {
+
+ public DbAdapter createAdapter(DatabaseMetaData md) throws SQLException {
+ String dbName = md.getDatabaseProductName();
+ return dbName != null && dbName.toUpperCase().contains("NUODB")
+ ? new NuodbAdapter()
+ : null;
+ }
+
+}
Added:
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/types.xml
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/types.xml?rev=1378906&view=auto
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/types.xml
(added)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-jdk1.5-unpublished/src/main/resources/org/apache/cayenne/dba/nuodb/types.xml
Thu Aug 30 12:24:05 2012
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!--
+H2 types mapping
+-->
+
+<types>
+ <jdbc-type name="BIGINT">
+ <db-type name="BIGINT"/>
+ </jdbc-type>
+ <jdbc-type name="BINARY">
+ <db-type name="BINARY"/>
+ </jdbc-type>
+ <jdbc-type name="BIT">
+ <db-type name="BOOLEAN"/>
+ </jdbc-type>
+ <jdbc-type name="BLOB">
+ <db-type name="BLOB"/>
+ </jdbc-type>
+ <jdbc-type name="BOOLEAN">
+ <db-type name="INTEGER"/>
+ </jdbc-type>
+ <jdbc-type name="CHAR">
+ <db-type name="CHAR"/>
+ </jdbc-type>
+ <jdbc-type name="CLOB">
+ <db-type name="CLOB"/>
+ </jdbc-type>
+ <jdbc-type name="DATE">
+ <db-type name="DATE"/>
+ </jdbc-type>
+ <jdbc-type name="DECIMAL">
+ <db-type name="DECIMAL"/>
+ </jdbc-type>
+ <jdbc-type name="DOUBLE">
+ <db-type name="DOUBLE"/>
+ </jdbc-type>
+ <jdbc-type name="FLOAT">
+ <db-type name="FLOAT"/>
+ </jdbc-type>
+ <jdbc-type name="INTEGER">
+ <db-type name="INTEGER"/>
+ </jdbc-type>
+ <jdbc-type name="LONGVARBINARY">
+ <db-type name="LONGVARBINARY"/>
+ </jdbc-type>
+ <jdbc-type name="LONGVARCHAR">
+ <db-type name="CLOB"/>
+ </jdbc-type>
+ <jdbc-type name="NUMERIC">
+ <db-type name="NUMERIC"/>
+ </jdbc-type>
+ <jdbc-type name="REAL">
+ <db-type name="REAL"/>
+ </jdbc-type>
+ <jdbc-type name="SMALLINT">
+ <db-type name="SMALLINT"/>
+ </jdbc-type>
+ <jdbc-type name="TIME">
+ <db-type name="TIME"/>
+ </jdbc-type>
+ <jdbc-type name="TIMESTAMP">
+ <db-type name="TIMESTAMP"/>
+ </jdbc-type>
+ <jdbc-type name="TINYINT">
+ <db-type name="SMALLINT"/>
+ </jdbc-type>
+ <jdbc-type name="VARBINARY">
+ <db-type name="BLOB"/>
+ </jdbc-type>
+ <jdbc-type name="VARCHAR">
+ <db-type name="VARCHAR"/>
+ </jdbc-type>
+</types>
\ No newline at end of file
Modified:
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/AdapterMapping.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/AdapterMapping.java?rev=1378906&r1=1378905&r2=1378906&view=diff
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/AdapterMapping.java
(original)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/AdapterMapping.java
Thu Aug 30 12:24:05 2012
@@ -29,6 +29,7 @@ import org.apache.cayenne.dba.h2.H2Adapt
import org.apache.cayenne.dba.hsqldb.HSQLDBAdapter;
import org.apache.cayenne.dba.ingres.IngresAdapter;
import org.apache.cayenne.dba.mysql.MySQLAdapter;
+import org.apache.cayenne.dba.nuodb.NuodbAdapter;
import org.apache.cayenne.dba.openbase.OpenBaseAdapter;
import org.apache.cayenne.dba.oracle.OracleAdapter;
import org.apache.cayenne.dba.postgres.PostgresAdapter;
@@ -85,6 +86,7 @@ public class AdapterMapping {
jdbcDriverToAdapterMap.put("com.ingres.jdbc.IngresDriver",
IngresAdapter.class
.getName());
jdbcDriverToAdapterMap.put("org.sqlite.JDBC",
SQLiteAdapter.class.getName());
+ jdbcDriverToAdapterMap.put("com.nuodb.jdbc.Driver",
NuodbAdapter.class.getName());
// urls
adapterToJDBCURLMap.put(
@@ -116,6 +118,7 @@ public class AdapterMapping {
SQLServerAdapter.class.getName(),
"jdbc:microsoft:sqlserver://host;databaseName=database;SelectMethod=cursor");
adapterToJDBCURLMap.put(SQLiteAdapter.class.getName(),
"jdbc:sqlite:testdb");
+ adapterToJDBCURLMap.put(NuodbAdapter.class.getName(),
"jdbc:com.nuodb://localhost/database");
// TODO: embedded Derby Mode... change to client-server once we figure
it out
adapterToJDBCURLMap.put(
@@ -164,6 +167,7 @@ public class AdapterMapping {
IngresAdapter.class.getName(),
"com.ingres.jdbc.IngresDriver");
adapterToJDBCDriverMap.put(SQLiteAdapter.class.getName(),
"org.sqlite.JDBC");
+ adapterToJDBCDriverMap.put(NuodbAdapter.class.getName(),
"com.nuodb.jdbc.Driver");
// EOF plugins...
eofPluginToAdapterMap.put(
Modified:
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/DbAdapterInfo.java
URL:
http://svn.apache.org/viewvc/cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/DbAdapterInfo.java?rev=1378906&r1=1378905&r2=1378906&view=diff
==============================================================================
---
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/DbAdapterInfo.java
(original)
+++
cayenne/main/branches/STABLE-3.0/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/DbAdapterInfo.java
Thu Aug 30 12:24:05 2012
@@ -36,6 +36,7 @@ import org.apache.cayenne.dba.h2.H2Adapt
import org.apache.cayenne.dba.hsqldb.HSQLDBAdapter;
import org.apache.cayenne.dba.ingres.IngresAdapter;
import org.apache.cayenne.dba.mysql.MySQLAdapter;
+import org.apache.cayenne.dba.nuodb.NuodbAdapter;
import org.apache.cayenne.dba.openbase.OpenBaseAdapter;
import org.apache.cayenne.dba.oracle.OracleAdapter;
import org.apache.cayenne.dba.postgres.PostgresAdapter;
@@ -55,7 +56,8 @@ public final class DbAdapterInfo {
HSQLDBAdapter.class.getName(), DB2Adapter.class.getName(),
SQLServerAdapter.class.getName(), FrontBaseAdapter.class.getName(),
OpenBaseAdapter.class.getName(), DerbyAdapter.class.getName(),
- IngresAdapter.class.getName(), SQLiteAdapter.class.getName()
+ IngresAdapter.class.getName(), SQLiteAdapter.class.getName(),
+ NuodbAdapter.class.getName()
};
private static final Map<String, String> IMMUTABLE_LABELS = Collections
@@ -78,6 +80,7 @@ public final class DbAdapterInfo {
DEFAULT_ADAPTER_LABELS.put(DerbyAdapter.class.getName(), "Derby
Adapter");
DEFAULT_ADAPTER_LABELS.put(IngresAdapter.class.getName(), "Ingres
Adapter");
DEFAULT_ADAPTER_LABELS.put(SQLiteAdapter.class.getName(), "SQLite
Adapter");
+ DEFAULT_ADAPTER_LABELS.put(NuodbAdapter.class.getName(), "Nuodb
Adapter");
}
public static Map getStandardAdapterLabels() {