-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AD-545] JNI Interface to load query metadata (CPP) (#46)
### Summary [AD-545] JNI Interface to load query metadata (CPP) ### Description Expose JNI Interface for the follow... ``` DocumentDbConnection.getConnectionProperties() java.util.List List.size() List.get(Int) DocumentDbMqlQueryContext DocumentDbMqlQueryContext.getAggregateOperationsAsStrings() DocumentDbMqlQueryContext.getColumnMetadata() DocumentDbMqlQueryContext.getCollectionName() DocumentDbMqlQueryContext.getPaths() JdbcColumnMetadata JdbcColumnMetadata.getOrdinal() JdbcColumnMetadata.isAutoIncrement() JdbcColumnMetadata.isCaseSensitive() JdbcColumnMetadata.isSearchable() JdbcColumnMetadata.isCurrency() JdbcColumnMetadata.getNullable() JdbcColumnMetadata.isSigned() JdbcColumnMetadata.getColumnDisplaySize() JdbcColumnMetadata.getColumnLabel() JdbcColumnMetadata.getColumnName() JdbcColumnMetadata.getSchemaName() JdbcColumnMetadata.getPrecision() JdbcColumnMetadata.getScale() JdbcColumnMetadata.getTableName() JdbcColumnMetadata.getCatalogName() JdbcColumnMetadata.getColumnType() JdbcColumnMetadata.getColumnTypeName() JdbcColumnMetadata.isReadOnly() JdbcColumnMetadata.isWritable;() JdbcColumnMetadata.isDefinitelyWritable() JdbcColumnMetadata.getColumnClassName() DocumentDbQueryMappingService DocumentDbQueryMappingService.DocumentDbQueryMappingService(DocumentDbConnection, DocumetDbDatabaseMetadata) DocumentDbQueryMappingService.get() ``` ### Related Issue https://bitquill.atlassian.net/browse/AD-545 https://bitquill.atlassian.net/browse/AD-590 * [AD-587] JNI Interface to load query metadata (CPP) * [AD-587] JNI Interface to load query metadata (CPP) * [AD-545] Correct MacOS build issues. Remove unused interfaces. * [AD-545] Comments and code clean up. * [AD-545] Comments and code clean up. * [AD-545] Comments and code clean up. * [AD-545] Revert some changes not supported in C++ 11. * [AD-545] Improve error reporting when setting up JNI context. * [AD-545] Change JDBC driver version for MacOS. * [AD-545] Clean-up * [AD-545] Improvement on error handling getting connection. * [AD-545] Corrections from code review comments.
- Loading branch information
Bruce Irschick
authored
Mar 17, 2022
1 parent
e6429aa
commit db566bf
Showing
27 changed files
with
2,405 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/odbc/include/ignite/odbc/jni/documentdb_connection_properties.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#include <ignite/odbc/common/concurrent.h> | ||
#include <ignite/odbc/jni/java.h> | ||
#include <ignite/odbc/jni/result_set.h> | ||
|
||
#include <string> | ||
|
||
#ifndef _IGNITE_ODBC_JNI_DOCUMENTDB_CONNECTION_PROPERTIES | ||
#define _IGNITE_ODBC_JNI_DOCUMENTDB_CONNECTION_PROPERTIES | ||
|
||
using ignite::odbc::common::concurrent::SharedPointer; | ||
using ignite::odbc::jni::ResultSet; | ||
using ignite::odbc::jni::java::GlobalJObject; | ||
using ignite::odbc::jni::java::JniContext; | ||
using ignite::odbc::jni::java::JniErrorInfo; | ||
|
||
namespace ignite { | ||
namespace odbc { | ||
namespace jni { | ||
/** | ||
* Wrapper for the the DocumentDB connection properties. | ||
*/ | ||
class DocumentDbConnectionProperties { | ||
friend class DocumentDbConnection; | ||
friend class DocumentDbQueryMappingService; | ||
|
||
public: | ||
~DocumentDbConnectionProperties() = default; | ||
|
||
private: | ||
/** | ||
* Constructs an instance of the DocumentDbConnectionProperties class. | ||
*/ | ||
DocumentDbConnectionProperties( | ||
SharedPointer< JniContext >& jniContext, | ||
SharedPointer< GlobalJObject >& connectionProperties) | ||
: _jniContext(jniContext), _connectionProperties(connectionProperties) { | ||
} | ||
|
||
/** The JNI context */ | ||
SharedPointer< JniContext > _jniContext; | ||
|
||
/** The DocumentDbConnectionProperties Java object */ | ||
SharedPointer< GlobalJObject > _connectionProperties; | ||
}; | ||
} // namespace jni | ||
} // namespace odbc | ||
} // namespace ignite | ||
|
||
#endif // _IGNITE_ODBC_JNI_DOCUMENTDB_CONNECTION_PROPERTIES |
69 changes: 69 additions & 0 deletions
69
src/odbc/include/ignite/odbc/jni/documentdb_database_metadata.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#include <ignite/odbc/common/concurrent.h> | ||
#include <ignite/odbc/jni/java.h> | ||
#include <ignite/odbc/jni/result_set.h> | ||
|
||
#include <string> | ||
|
||
#ifndef _IGNITE_ODBC_JNI_DOCUMENTDB_DATABASE_METADATA | ||
#define _IGNITE_ODBC_JNI_DOCUMENTDB_DATABASE_METADATA | ||
|
||
using ignite::odbc::common::concurrent::SharedPointer; | ||
using ignite::odbc::jni::ResultSet; | ||
using ignite::odbc::jni::java::GlobalJObject; | ||
using ignite::odbc::jni::java::JniContext; | ||
using ignite::odbc::jni::java::JniErrorInfo; | ||
|
||
namespace ignite { | ||
namespace odbc { | ||
namespace jni { | ||
/** | ||
* Wrapper for the the DocumentDB database metadata. | ||
*/ | ||
class DocumentDbDatabaseMetadata { | ||
friend class DocumentDbConnection; | ||
friend class DocumentDbQueryMappingService; | ||
|
||
public: | ||
/** | ||
* Destructs a DocumentDbDatabaseMetadata instance. | ||
*/ | ||
~DocumentDbDatabaseMetadata() = default; | ||
|
||
private: | ||
/** | ||
* Constructs an instance of the DocumentDbDatabaseMetadata class. | ||
*/ | ||
DocumentDbDatabaseMetadata( | ||
SharedPointer< JniContext >& jniContext, | ||
SharedPointer< GlobalJObject >& databaseMetadata) | ||
: _jniContext(jniContext), _databaseMetadata(databaseMetadata) { | ||
} | ||
|
||
/** The JNI context */ | ||
SharedPointer< JniContext > _jniContext; | ||
|
||
/** The DocumentDbDatabaseMetadata Java object */ | ||
SharedPointer< GlobalJObject > _databaseMetadata; | ||
}; | ||
} // namespace jni | ||
} // namespace odbc | ||
} // namespace ignite | ||
|
||
#endif // _IGNITE_ODBC_JNI_DOCUMENTDB_DATABASE_METADATA |
Oops, something went wrong.