File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2002-present the original author or authors.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package org .springframework .jdbc .core .metadata ;
18+
19+ import java .sql .DatabaseMetaData ;
20+ import java .sql .SQLException ;
21+
22+ /**
23+ * The MySQL/MariaDB specific implementation of {@link TableMetaDataProvider}.
24+ * Sets {@link #setGeneratedKeysColumnNameArraySupported} to {@code false}.
25+ *
26+ * @author Juergen Hoeller
27+ * @since 6.2.12
28+ */
29+ public class MySQLTableMetaDataProvider extends GenericTableMetaDataProvider {
30+
31+ public MySQLTableMetaDataProvider (DatabaseMetaData databaseMetaData ) throws SQLException {
32+ super (databaseMetaData );
33+ setGeneratedKeysColumnNameArraySupported (false );
34+ }
35+
36+ }
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ else if ("Apache Derby".equals(databaseProductName)) {
6666 else if ("HSQL Database Engine" .equals (databaseProductName )) {
6767 provider = new HsqlTableMetaDataProvider (databaseMetaData );
6868 }
69+ else if ("MySQL" .equals (databaseProductName ) || "MariaDB" .equals (databaseProductName )) {
70+ provider = new MySQLTableMetaDataProvider (databaseMetaData );
71+ }
6972 else {
7073 provider = new GenericTableMetaDataProvider (databaseMetaData );
7174 }
You can’t perform that action at this time.
0 commit comments