From 1ef0db0b0b75da108916bb695f9502e356d7375e Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Fri, 9 May 2008 04:58:51 +0000 Subject: Rename resolver class. --- .../amazon/carbonado/repo/jdbc/JDBCRepository.java | 4 +- .../carbonado/repo/jdbc/JDBCRepositoryBuilder.java | 4 +- .../repo/jdbc/JDBCStorableIntrospector.java | 8 ++-- .../amazon/carbonado/repo/jdbc/SchemaResolver.java | 43 ++++++++++++++++++++++ .../carbonado/repo/jdbc/SupportResolver.java | 43 ---------------------- 5 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 src/main/java/com/amazon/carbonado/repo/jdbc/SchemaResolver.java delete mode 100644 src/main/java/com/amazon/carbonado/repo/jdbc/SupportResolver.java (limited to 'src/main/java/com/amazon/carbonado') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java index 870ab34..6849ca8 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepository.java @@ -195,7 +195,7 @@ class JDBCRepository extends AbstractRepository private final JDBCSupportStrategy mSupportStrategy; private JDBCExceptionTransformer mExceptionTransformer; - private final SupportResolver mResolver; + private final SchemaResolver mResolver; private final JDBCTransactionManager mTxnMgr; @@ -227,7 +227,7 @@ class JDBCRepository extends AbstractRepository Map autoVersioningMap, Map suppressReloadMap, String sequenceSelectStatement, boolean forceStoredSequence, - SupportResolver resolver) + SchemaResolver resolver) throws RepositoryException { super(name); diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java index 9117884..57629b6 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCRepositoryBuilder.java @@ -76,7 +76,7 @@ public class JDBCRepositoryBuilder extends AbstractRepositoryBuilder { private String mSequenceSelectStatement; private boolean mForceStoredSequence; - private SupportResolver mResolver; + private SchemaResolver mResolver; public JDBCRepositoryBuilder() { } @@ -413,7 +413,7 @@ public class JDBCRepositoryBuilder extends AbstractRepositoryBuilder { } // Experimental feature. - void setSupportResolver(SupportResolver resolver) { + void setSchemaResolver(SchemaResolver resolver) { mResolver = resolver; } } diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java index 245afd6..98235cb 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorableIntrospector.java @@ -101,7 +101,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector { } public static JDBCStorableInfo examine - (Class type, DataSource ds, String catalog, String schema, SupportResolver resolver) + (Class type, DataSource ds, String catalog, String schema, SchemaResolver resolver) throws SQLException, SupportException { Object key = KeyFactory.createKey(new Object[] {type, ds, catalog, schema}); @@ -156,7 +156,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector { private static JDBCStorableInfo examine (StorableInfo mainInfo, Connection con, final String searchCatalog, final String searchSchema, - SupportResolver resolver) + SchemaResolver resolver) throws SQLException, SupportException { DatabaseMetaData meta = con.getMetaData(); @@ -1414,7 +1414,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector { @SuppressWarnings("unchecked") void fillInternalJoinElements(DataSource ds, String catalog, String schema, - SupportResolver resolver) + SchemaResolver resolver) throws SQLException, SupportException { StorableProperty[] mainInternal = mMainProperty.getInternalJoinElements(); @@ -1433,7 +1433,7 @@ public class JDBCStorableIntrospector extends StorableIntrospector { } void fillExternalJoinElements(DataSource ds, String catalog, String schema, - SupportResolver resolver) + SchemaResolver resolver) throws SQLException, SupportException { StorableProperty[] mainExternal = mMainProperty.getExternalJoinElements(); diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/SchemaResolver.java b/src/main/java/com/amazon/carbonado/repo/jdbc/SchemaResolver.java new file mode 100644 index 0000000..da260b8 --- /dev/null +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/SchemaResolver.java @@ -0,0 +1,43 @@ +/* + * Copyright 2008 Amazon Technologies, Inc. or its affiliates. + * Amazon, Amazon.com and Carbonado are trademarks or registered trademarks + * of Amazon Technologies, Inc. or its affiliates. All rights reserved. + * + * Licensed 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 com.amazon.carbonado.repo.jdbc; + +import java.sql.Connection; +import java.sql.SQLException; + +import com.amazon.carbonado.RepositoryException; +import com.amazon.carbonado.Storable; +import com.amazon.carbonado.SupportException; +import com.amazon.carbonado.info.StorableInfo; + +/** + * Experimental interface for allowing tables to be created or altered when the + * Storable definition doesn't match the table or the table doesn't + * exist. Currently only used by unit tests. + * + * @author Brian S O'Neill + */ +interface SchemaResolver { + /** + * @return true if support has been resolved + */ + boolean resolve(StorableInfo info, + Connection con, String catalog, String schema) + throws SQLException; +} diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/SupportResolver.java b/src/main/java/com/amazon/carbonado/repo/jdbc/SupportResolver.java deleted file mode 100644 index 3c99b54..0000000 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/SupportResolver.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2008 Amazon Technologies, Inc. or its affiliates. - * Amazon, Amazon.com and Carbonado are trademarks or registered trademarks - * of Amazon Technologies, Inc. or its affiliates. All rights reserved. - * - * Licensed 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 com.amazon.carbonado.repo.jdbc; - -import java.sql.Connection; -import java.sql.SQLException; - -import com.amazon.carbonado.RepositoryException; -import com.amazon.carbonado.Storable; -import com.amazon.carbonado.SupportException; -import com.amazon.carbonado.info.StorableInfo; - -/** - * Experimental interface for allowing tables to be created or altered when the - * Storable definition doesn't match the table or the table doesn't - * exist. Currently only used by unit tests. - * - * @author Brian S O'Neill - */ -interface SupportResolver { - /** - * @return true if support has been resolved - */ - boolean resolve(StorableInfo info, - Connection con, String catalog, String schema) - throws SQLException; -} -- cgit v1.2.3