mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-12-22 07:18:51 -05:00
Profiles to test oracle and hsql special DatabaseTypes
This commit is contained in:
parent
5057a282bd
commit
c899d07a71
@ -5,5 +5,27 @@
|
|||||||
<username>${env.SONATYPE_USERNAME}</username>
|
<username>${env.SONATYPE_USERNAME}</username>
|
||||||
<password>${env.SONATYPE_PASSWORD}</password>
|
<password>${env.SONATYPE_PASSWORD}</password>
|
||||||
</server>
|
</server>
|
||||||
|
<server>
|
||||||
|
<id>maven.oracle.com</id>
|
||||||
|
<username>${env.ORACLE_LOGIN_userid}</username>
|
||||||
|
<password>${env.ORACLE_LOGIN_pass}</password>
|
||||||
|
<configuration>
|
||||||
|
<basicAuthScope>
|
||||||
|
<host>ANY</host>
|
||||||
|
<port>ANY</port>
|
||||||
|
<realm>OAM 11g</realm>
|
||||||
|
</basicAuthScope>
|
||||||
|
<httpConfiguration>
|
||||||
|
<all>
|
||||||
|
<params>
|
||||||
|
<property>
|
||||||
|
<name>http.protocol.allow-circular-redirects</name>
|
||||||
|
<value>%b,true</value>
|
||||||
|
</property>
|
||||||
|
</params>
|
||||||
|
</all>
|
||||||
|
</httpConfiguration>
|
||||||
|
</configuration>
|
||||||
|
</server>
|
||||||
</servers>
|
</servers>
|
||||||
</settings>
|
</settings>
|
@ -27,7 +27,10 @@ before_script:
|
|||||||
|
|
||||||
script:
|
script:
|
||||||
- docker ps -a
|
- docker ps -a
|
||||||
- mvn test -B '-DjdbcUrl1=jdbc:postgresql:test_db' '-DjdbcUrl2=jdbc:mariadb://127.0.0.1:3306/test_db?user=root' '-DjdbcUrl3=jdbc:sqlserver://localhost:1433;databaseName=master;username=sa;password=<YourStrong!Passw0rd>;'
|
- mvn -B -pl '!test' clean install || travis_terminate 1;
|
||||||
|
- mvn -B -pl test clean test '-DjdbcUrl1=jdbc:postgresql:test_db' '-DjdbcUrl2=jdbc:mariadb://127.0.0.1:3306/test_db?user=root' '-DjdbcUrl3=jdbc:sqlserver://localhost:1433;databaseName=master;username=sa;password=<YourStrong!Passw0rd>;' || travis_terminate 1;
|
||||||
|
- mvn -B -pl test clean test -P oracle '-DjdbcUrl=derby' || travis_terminate 1; # todo: change jdbcUrl to actual oracle datasource
|
||||||
|
- mvn -B -pl test clean test -P unnest '-DjdbcUrl=hsqldb' || travis_terminate 1;
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
@ -126,7 +126,7 @@ public class JdbcMapperProcessor extends AbstractProcessor {
|
|||||||
enumType = types.getDeclaredType(elements.getTypeElement(Enum.class.getCanonicalName()), types.getWildcardType(null, null));
|
enumType = types.getDeclaredType(elements.getTypeElement(Enum.class.getCanonicalName()), types.getWildcardType(null, null));
|
||||||
|
|
||||||
final String databaseType = processingEnv.getOptions().get("jdbcMapper.databaseType");
|
final String databaseType = processingEnv.getOptions().get("jdbcMapper.databaseType");
|
||||||
defaultDatabaseType = databaseType == null ? JdbcMapper.DatabaseType.STANDARD : JdbcMapper.DatabaseType.valueOf(databaseType);
|
defaultDatabaseType = databaseType == null || databaseType.isEmpty() ? JdbcMapper.DatabaseType.STANDARD : JdbcMapper.DatabaseType.valueOf(databaseType);
|
||||||
defaultArrayNumberTypeName = processingEnv.getOptions().get("jdbcMapper.arrayNumberTypeName");
|
defaultArrayNumberTypeName = processingEnv.getOptions().get("jdbcMapper.arrayNumberTypeName");
|
||||||
if (defaultArrayNumberTypeName == null || defaultArrayNumberTypeName.isEmpty())
|
if (defaultArrayNumberTypeName == null || defaultArrayNumberTypeName.isEmpty())
|
||||||
defaultArrayNumberTypeName = defaultDatabaseType.arrayNumberTypeName;
|
defaultArrayNumberTypeName = defaultDatabaseType.arrayNumberTypeName;
|
||||||
|
56
test/pom.xml
56
test/pom.xml
@ -133,5 +133,61 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>oracle</id>
|
||||||
|
<properties>
|
||||||
|
<oracle.driver.artifact>ojdbc6</oracle.driver.artifact>
|
||||||
|
<oracle.driver.version>11.2.0.4</oracle.driver.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.jdbc</groupId>
|
||||||
|
<artifactId>${oracle.driver.artifact}</artifactId>
|
||||||
|
<version>${oracle.driver.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>maven.oracle.com</id>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
<url>https://maven.oracle.com</url>
|
||||||
|
<layout>default</layout>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<compilerArg>-AjdbcMapper.databaseType=ORACLE</compilerArg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>unnest</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<compilerArg>-AjdbcMapper.databaseType=UNNEST</compilerArg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
@ -20,7 +20,7 @@ import java.time.*;
|
|||||||
*/
|
*/
|
||||||
@JdbcMapper.Mapper(
|
@JdbcMapper.Mapper(
|
||||||
jndiName = "bob",
|
jndiName = "bob",
|
||||||
// databaseType = JdbcMapper.DatabaseType.ORACLE
|
databaseType = JdbcMapper.DatabaseType.STANDARD, // todo: PrestoPersonDao breaks with ORACLE or UNNEST
|
||||||
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
|
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
|
||||||
// , sqlParser = SimpleSQLParser.class
|
// , sqlParser = SimpleSQLParser.class
|
||||||
, allowReflection = JdbcMapper.OptionalBool.TRUE
|
, allowReflection = JdbcMapper.OptionalBool.TRUE
|
||||||
|
@ -20,7 +20,7 @@ import java.time.*;
|
|||||||
*/
|
*/
|
||||||
@JdbcMapper.Mapper(
|
@JdbcMapper.Mapper(
|
||||||
jndiName = "bob",
|
jndiName = "bob",
|
||||||
// databaseType = JdbcMapper.DatabaseType.ORACLE
|
databaseType = JdbcMapper.DatabaseType.STANDARD, // PrestoPersonDao breaks with ORACLE or UNNEST
|
||||||
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
|
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
|
||||||
, sqlParser = PrestoSQLParser.class
|
, sqlParser = PrestoSQLParser.class
|
||||||
, allowReflection = JdbcMapper.OptionalBool.TRUE
|
, allowReflection = JdbcMapper.OptionalBool.TRUE
|
||||||
|
Loading…
Reference in New Issue
Block a user