Skip to content

Commit

Permalink
Merge pull request #1206 from lat-lon/updatedOracle-189-239-250-7692
Browse files Browse the repository at this point in the history
Fix Oracle 11g.R2 compability, upgrade Oracle Driver to 19.3.0.0 and remove use of profile for public available Oracle database drivers
  • Loading branch information
copierrj authored Feb 2, 2022
2 parents a2e4f2d + d900cc6 commit e304b64
Show file tree
Hide file tree
Showing 16 changed files with 291 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
* @author last edited by: $Author: wanhoff $
*
*/
public abstract class AbstractSQLDialect implements SQLDialect{
public abstract class AbstractSQLDialect implements SQLDialect {

private char defaultEscapeChar = Character.UNASSIGNED;
private char defaultEscapeChar = Character.UNASSIGNED;

@Override
public char getLeadingEscapeChar() {
Expand All @@ -56,4 +56,9 @@ public char getTailingEscapeChar() {
return defaultEscapeChar;
}

@Override
public boolean isRowLimitingCapable() {
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Envelope getBBoxAggregateValue( ResultSet rs, int colIdx, ICRS crs )
* name of the database to be created, must not be <code>null</code>
* @throws SQLException
*/
public void createDB( Connection adminConn, String dbName )
void createDB( Connection adminConn, String dbName )
throws SQLException;

/**
Expand All @@ -187,21 +187,21 @@ public void createDB( Connection adminConn, String dbName )
* name of the database to be created, must not be <code>null</code>
* @throws SQLException
*/
public void dropDB( Connection adminConn, String dbName )
void dropDB( Connection adminConn, String dbName )
throws SQLException;

public void createAutoColumn( StringBuffer currentStmt, List<StringBuffer> additionalSmts, SQLIdentifier column,
void createAutoColumn( StringBuffer currentStmt, List<StringBuffer> additionalSmts, SQLIdentifier column,
SQLIdentifier table );

public ResultSet getTableColumnMetadata( DatabaseMetaData md, TableName table )
ResultSet getTableColumnMetadata( DatabaseMetaData md, TableName table )
throws SQLException;

/**
* Returns whether a transaction context is required for cursor mode to work.
*
* @return <code>true</code>, if a transaction context is required, <code>false</code> otherwise
*/
public boolean requiresTransactionForCursorMode();
boolean requiresTransactionForCursorMode();

/**
* Returns a <code>SELECT</code> statement for retrieving the next value in the specified DB sequence.
Expand All @@ -217,12 +217,17 @@ public ResultSet getTableColumnMetadata( DatabaseMetaData md, TableName table )
*
* @return leading escape char
*/
public char getLeadingEscapeChar();
char getLeadingEscapeChar();

/**
* Returns the tailing escape char for the SQLDialect
*
* @return tailing escape char
*/
public char getTailingEscapeChar();
char getTailingEscapeChar();

/**
* Returns whether a query can use row limiting syntax
*/
boolean isRowLimitingCapable();
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,6 @@
<version>3.4.24-SNAPSHOT</version>
</parent>

<profiles>
<profile>
<id>oracle</id>
<repositories>
<repository>
<id>deegree-restricted</id>
<name>deegree-restricted</name>
<url>https://repo.deegree.org/content/repositories/private3rdparty</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>org.deegree</groupId>
Expand All @@ -45,6 +26,10 @@
<artifactId>deegree-core-db</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
Expand All @@ -55,5 +40,4 @@
</dependency>
</dependencies>

</project>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,8 @@ public String getSelectSequenceNextVal( String sequence ) {
return "SELECT " + sequence + ".NEXTVAL from DUAL";
}

@Override
public boolean isRowLimitingCapable() {
return versionMajor < 12 ? false: true;
}
}
7 changes: 1 addition & 6 deletions deegree-core/deegree-core-sqldialect/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
</parent>

<profiles>
<profile>
<id>oracle</id>
<modules>
<module>deegree-sqldialect-oracle</module>
</modules>
</profile>
<profile>
<id>mssql</id>
<modules>
Expand All @@ -29,6 +23,7 @@
<modules>
<module>deegree-sqldialect-commons</module>
<module>deegree-sqldialect-postgis</module>
<module>deegree-sqldialect-oracle</module>
</modules>

</project>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<dependency>
Expand All @@ -84,8 +84,8 @@
<artifactId>sdoutl</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>xdb6</artifactId>
<groupId>com.oracle.database.xml</groupId>
<artifactId>xdb</artifactId>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
Expand All @@ -94,4 +94,3 @@
</dependencies>

</project>

Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public interface FeatureStore extends Resource {
*/
boolean isMapped( QName ftName );

/**
* Returns whether the store supports evaluation of maxFeatures and startIndex.
*
* @param queries
* the queries to check if evaluation of maxFeatures and startIndex is applicable, must not be <code>null</code>
* @return <code>true</code>, if evaluation of maxFeatures and startIndex is applicable, <code>false</code> otherwise
*/
boolean isMaxFeaturesAndStartIndexApplicable( Query[] queries );

/**
* Returns the envelope for all stored features of the given type.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ public enum QueryHint {

private int maxFeatures = -1;

private int startIndex = 0;

private final List<ProjectionClause> projections;

/**
Expand Down Expand Up @@ -156,6 +158,34 @@ public Query( TypeName[] typeNames, Filter filter, String featureVersion, ICRS s
this.projections = emptyList();
}

/**
* Creates a new {@link Query} instance.
*
* @param typeNames
* feature type names to be queried, must not be <code>null</code> and contain at least one entry
* @param filter
* filter to be applied, can be <code>null</code>, if not <code>null</code>, all contained geometry
* operands must have a non-null {@link CRS}
* @param sortBy
* sort criteria to be applied, can be <code>null</code>
* @param maxFeatures
* number of features to return, if not specified: -1
* @param startIndex
* index of the first feature to return, default: 0
*/
public Query( TypeName[] typeNames, Filter filter, SortProperty[] sortBy, int maxFeatures, int startIndex ) {
this.typeNames = typeNames;
this.filter = filter;
this.maxFeatures = maxFeatures;
this.startIndex = startIndex;
if ( sortBy != null ) {
this.sortBy = sortBy;
} else {
this.sortBy = new SortProperty[0];
}
this.projections = emptyList();
}

/**
* Creates a new {@link Query} instance.
*
Expand Down Expand Up @@ -287,4 +317,12 @@ public List<ProjectionClause> getProjections() {
public int getMaxFeatures() {
return maxFeatures;
}

/**
* @return the index of the first feature to return
*/
public int getStartIndex() {
return startIndex;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ public boolean isMapped( QName ftName ) {
return schema.getFeatureType( ftName ) != null;
}

@Override
public boolean isMaxFeaturesAndStartIndexApplicable( Query[] queries ) {
return false;
}

@Override
public FeatureInputStream query( Query query )
throws FilterEvaluationException, FeatureStoreException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ public boolean isMapped( QName ftName ) {
return appSchema.getFeatureType( ftName ) != null;
}

@Override
public boolean isMaxFeaturesAndStartIndexApplicable( Query[] queries ) {
return false;
}

@Override
public Envelope getEnvelope( QName ftName )
throws FeatureStoreException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ public boolean isMapped( QName ftName ) {
return schema.getFeatureType( ftName ) != null;
}

@Override
public boolean isMaxFeaturesAndStartIndexApplicable( Query[] queries ) {
return false;
}

/**
* Returns the CRS used by the shape file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ public boolean isAvailable() {
return available;
}

@Override
public boolean isMaxFeaturesAndStartIndexApplicable( Query[] queries ) {
return false;
}

public FeatureInputStream query( Query query )
throws FeatureStoreException, FilterEvaluationException {
return query( new Query[] { query } );
Expand Down
Loading

0 comments on commit e304b64

Please sign in to comment.