-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Alexandre Jacob <alexandref.jacob@gmail.com>
- Loading branch information
Showing
18 changed files
with
160 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License v. 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0, | ||
# or the Eclipse Distribution License v. 1.0 which is available at | ||
# http://www.eclipse.org/org/documents/edl-v10.php. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
# | ||
|
||
# DB Connection properties | ||
db.driver=org.mariadb.jdbc.Driver | ||
db.url=jdbc:mariadb://localhost:3306/ecltests?allowPublicKeyRetrieval=true | ||
db.user=root | ||
db.pwd=root | ||
db.platform=org.eclipse.persistence.platform.database.MariaDBPlatform | ||
datasource.type=java.sql.Driver | ||
|
||
# Logging option for debugging | ||
logging.level=info |
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
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
82 changes: 82 additions & 0 deletions
82
...istence.core/src/main/java/org/eclipse/persistence/platform/database/MariaDBPlatform.java
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,82 @@ | ||
/* | ||
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
*/ | ||
|
||
package org.eclipse.persistence.platform.database; | ||
|
||
import org.eclipse.persistence.queries.ValueReadQuery; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
/** | ||
* <p><b>Purpose</b>: Provides MariaDB specific behavior. | ||
*/ | ||
public class MariaDBPlatform extends MySQLPlatform { | ||
|
||
@Override | ||
public void initializeConnectionData(Connection connection) throws SQLException { | ||
this.driverSupportsNationalCharacterVarying = true; | ||
} | ||
|
||
@Override | ||
public boolean isMariaDB() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isMySQL() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isFractionalTimeSupported() { | ||
return true; | ||
} | ||
|
||
/** | ||
* INTERNAL: Indicates whether the platform supports sequence objects. | ||
*/ | ||
@Override | ||
public boolean supportsSequenceObjects() { | ||
return true; | ||
} | ||
|
||
/** | ||
* INTERNAL: Returns query used to read value generated by sequence object | ||
* (like Oracle sequence). This method is called when sequence object | ||
* NativeSequence is connected, the returned query used until the sequence | ||
* is disconnected. If the platform supportsSequenceObjects then (at least) | ||
* one of buildSelectQueryForSequenceObject methods should return non-null | ||
* query. | ||
*/ | ||
@Override | ||
public ValueReadQuery buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size) { | ||
return new ValueReadQuery("select nextval(" + qualifiedSeqName + ")"); | ||
} | ||
|
||
/** | ||
* INTERNAL: Override this method if the platform supports sequence objects | ||
* and it's possible to alter sequence object's increment in the database. | ||
*/ | ||
@Override | ||
public boolean isAlterSequenceObjectSupported() { | ||
return true; | ||
} | ||
|
||
/** | ||
* Return the drop schema definition. Subclasses should override as needed. | ||
*/ | ||
@Override | ||
public String getDropDatabaseSchemaString(String schema) { | ||
return "DROP SCHEMA IF EXISTS " + schema; | ||
} | ||
} |
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
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
Oops, something went wrong.