-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into OPENJPA-2817_PCClassFileTransformer-exclus…
…ions
- Loading branch information
Showing
21 changed files
with
905 additions
and
92 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,38 @@ | ||
# | ||
# 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. | ||
# | ||
name: Java CI | ||
on: [push, pull_request] | ||
env: | ||
MAVEN_OPTS: -Dmaven.artifact.threads=256 -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: 'Set up JDK 1.8' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '1.8' | ||
- name: 'Cache Maven packages' | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: 'cache' | ||
restore-keys: 'cache' | ||
- name: 'Build with Maven' | ||
run: mvn -B install --file pom.xml | ||
- name: 'Remove Snapshots Before Caching' | ||
run: find ~/.m2 -name '*SNAPSHOT' | xargs rm -Rf |
File renamed without changes.
Empty file.
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
46 changes: 46 additions & 0 deletions
46
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/HerdDBDictionary.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,46 @@ | ||
/* | ||
* 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.openjpa.jdbc.sql; | ||
|
||
/** | ||
* Dictionary for HerdDB. | ||
*/ | ||
public class HerdDBDictionary | ||
extends org.apache.openjpa.jdbc.sql.DBDictionary { | ||
|
||
private static final String DELIMITER_BACK_TICK = "`"; | ||
|
||
public HerdDBDictionary() { | ||
platform = "HerdDB"; | ||
databaseProductName = "HerdDB"; | ||
supportsForeignKeys = false; | ||
supportsUniqueConstraints = false; | ||
supportsCascadeDeleteAction = false; | ||
schemaCase = SCHEMA_CASE_LOWER; | ||
delimitedCase = SCHEMA_CASE_PRESERVE; | ||
|
||
// make OpenJPA escape everything, because Apache Calcite has a lot of reserved words, like 'User', 'Value'... | ||
setDelimitIdentifiers(true); | ||
setSupportsDelimitedIdentifiers(true); | ||
setLeadingDelimiter(DELIMITER_BACK_TICK); | ||
setTrailingDelimiter(DELIMITER_BACK_TICK); | ||
} | ||
|
||
} | ||
|
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
61 changes: 61 additions & 0 deletions
61
openjpa-jdbc/src/test/java/org/apache/openjpa/jdbc/sql/DBDictionaryFactoryTest.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,61 @@ | ||
/* | ||
* Copyright 2020 Apache Software Foundation. | ||
* | ||
* 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 org.apache.openjpa.jdbc.sql; | ||
|
||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
import org.apache.openjpa.jdbc.conf.JDBCConfiguration; | ||
import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl; | ||
|
||
public class DBDictionaryFactoryTest { | ||
|
||
@Test | ||
public void testDictionaryClassForString() { | ||
JDBCConfiguration conf = new JDBCConfigurationImpl(); | ||
|
||
String[] aliases = new String[]{ | ||
"access", org.apache.openjpa.jdbc.sql.AccessDictionary.class.getName(), | ||
"db2", org.apache.openjpa.jdbc.sql.DB2Dictionary.class.getName(), | ||
"derby", org.apache.openjpa.jdbc.sql.DerbyDictionary.class.getName(), | ||
"empress", org.apache.openjpa.jdbc.sql.EmpressDictionary.class.getName(), | ||
"foxpro", org.apache.openjpa.jdbc.sql.FoxProDictionary.class.getName(), | ||
"h2", org.apache.openjpa.jdbc.sql.H2Dictionary.class.getName(), | ||
"hsql", org.apache.openjpa.jdbc.sql.HSQLDictionary.class.getName(), | ||
"informix", org.apache.openjpa.jdbc.sql.InformixDictionary.class.getName(), | ||
"ingres", org.apache.openjpa.jdbc.sql.IngresDictionary.class.getName(), | ||
"jdatastore", org.apache.openjpa.jdbc.sql.JDataStoreDictionary.class.getName(), | ||
"mariadb", org.apache.openjpa.jdbc.sql.MariaDBDictionary.class.getName(), | ||
"mysql", org.apache.openjpa.jdbc.sql.MySQLDictionary.class.getName(), | ||
"herddb", org.apache.openjpa.jdbc.sql.HerdDBDictionary.class.getName(), | ||
"oracle", org.apache.openjpa.jdbc.sql.OracleDictionary.class.getName(), | ||
"pointbase", org.apache.openjpa.jdbc.sql.PointbaseDictionary.class.getName(), | ||
"postgres", org.apache.openjpa.jdbc.sql.PostgresDictionary.class.getName(), | ||
"soliddb", org.apache.openjpa.jdbc.sql.SolidDBDictionary.class.getName(), | ||
"sqlserver", org.apache.openjpa.jdbc.sql.SQLServerDictionary.class.getName(), | ||
"sybase", org.apache.openjpa.jdbc.sql.SybaseDictionary.class.getName(), | ||
"maxdb", MaxDBDictionary.class.getName(), | ||
"jdbc:h2:", H2Dictionary.class.getName(), | ||
"h2 database", H2Dictionary.class.getName() | ||
}; | ||
|
||
for (int i = 0; i < aliases.length; i++) { | ||
String key = aliases[i++]; | ||
String expected = aliases[i]; | ||
assertEquals(expected, DBDictionaryFactory.dictionaryClassForString(key, conf)); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.