Fix checkstyle errors

This commit is contained in:
Karel Maesen 2021-09-18 17:37:54 +02:00
parent 5bae2d8196
commit cf854c5cfc
8 changed files with 46 additions and 144 deletions

View File

@ -10,6 +10,7 @@ package org.hibernate.spatial;
* Enumeration of types of Spatial Aggregation
*
* @author Karel Maesen
* @deprecated Will be removed in 6.0
*/
@Deprecated
public interface SpatialAggregate {

View File

@ -10,6 +10,7 @@ package org.hibernate.spatial;
* The spatial analysis functions defined in the OGC SFS specification.
*
* @author Karel Maesen
* @deprecated Will be removed in 6
*/
@Deprecated
public interface SpatialAnalysis {

View File

@ -12,93 +12,9 @@ import java.io.Serializable;
* Describes the features of a spatially enabled dialect.
*
* @author Karel Maesen
*
* @deprecated To be removed in 6
*/
@Deprecated
public interface SpatialDialect extends Serializable {
// /**
// * Returns the SQL fragment for the SQL WHERE-clause when parsing
// * <code>org.hibernatespatial.criterion.SpatialRelateExpression</code>s
// * into prepared statements.
// * <p/>
// *
// * @param columnName The name of the geometry-typed column to which the relation is
// * applied
// * @param spatialRelation The type of spatial relation (as defined in
// * <code>SpatialRelation</code>).
// *
// * @return SQL fragment {@code SpatialRelateExpression}
// */
// String getSpatialRelateSQL(String columnName, int spatialRelation);
//
// /**
// * Returns the SQL fragment for the SQL WHERE-expression when parsing
// * <code>org.hibernate.spatial.criterion.SpatialFilterExpression</code>s
// * into prepared statements.
// *
// * @param columnName The name of the geometry-typed column to which the filter is
// * be applied
// *
// * @return Rhe SQL fragment for the {@code SpatialFilterExpression}
// */
// String getSpatialFilterExpression(String columnName);
//
// /**
// * Returns the SQL fragment for the specfied Spatial aggregate expression.
// *
// * @param columnName The name of the Geometry property
// * @param aggregation The type of <code>SpatialAggregate</code>
// *
// * @return The SQL fragment for the projection
// */
// String getSpatialAggregateSQL(String columnName, int aggregation);
//
// /**
// * Returns The SQL fragment when parsing a <code>DWithinExpression</code>.
// *
// * @param columnName The geometry column to test against
// *
// * @return The SQL fragment when parsing a <code>DWithinExpression</code>.
// */
// String getDWithinSQL(String columnName);
//
// /**
// * Returns the SQL fragment when parsing a <code>HavingSridExpression</code>.
// *
// * @param columnName The geometry column to test against
// *
// * @return The SQL fragment for a <code>HavingSridExpression</code>.
// */
// String getHavingSridSQL(String columnName);
//
//
// /**
// * Returns the SQL fragment when parsing a <code>IsEmptyExpression</code> or
// * <code>IsNotEmpty</code> expression.
// *
// * @param columnName The geometry column
// * @param isEmpty Whether the geometry is tested for empty or non-empty
// *
// * @return The SQL fragment for the isempty function
// */
// String getIsEmptySQL(String columnName, boolean isEmpty);
//
// /**
// * Returns true if this <code>SpatialDialect</code> supports a specific filtering function.
// * <p> This is intended to signal DB-support for fast window queries, or MBR-overlap queries.</p>
// *
// * @return True if filtering is supported
// */
// boolean supportsFiltering();
//
// /**
// * Does this dialect supports the specified <code>SpatialFunction</code>.
// *
// * @param function <code>SpatialFunction</code>
// *
// * @return True if this <code>SpatialDialect</code> supports the spatial function specified by the function parameter.
// */
// boolean supports(SpatialFunction function);
}

View File

@ -13,6 +13,7 @@ package org.hibernate.spatial;
* section 2.1.13.3. "</p>
*
* @author Karel Maesen
* @deprecated Will be removed in 6
*/
@Deprecated
public interface SpatialRelation {

View File

@ -13,6 +13,7 @@ import org.hibernate.spatial.SpatialDialect;
/**
* An @{code SpatialDialect} for CockroachDB 20.2 and later. CockroachDB's spatial features where introduced in
* that version.
* @deprecated Spatial Dialects are no longer needed. Use the standard CockroachDB dialects
*/
@Deprecated
public class CockroachDB202SpatialDialect extends CockroachDialect implements SpatialDialect {

View File

@ -38,4 +38,4 @@ public interface OracleSpatialAggregate extends org.hibernate.spatial.SpatialAgg
* CONVEXHULL aggregate function
*/
public static int CONVEXHULL = 104;
}
}

View File

@ -10,7 +10,6 @@ import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import org.hibernate.NotYetImplementedFor6Exception;
import org.hibernate.spatial.SpatialFunction;
import org.geolatte.geom.Geometry;
@ -50,8 +49,7 @@ public class GeolatteSpatialPredicates {
Expression<? extends Geometry> geometry2) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( ST_EQUALS.name(), boolean.class,
geometry1, geometry2
criteriaBuilder.function( ST_EQUALS.name(), boolean.class, geometry1, geometry2
)
);
}
@ -70,8 +68,7 @@ public class GeolatteSpatialPredicates {
public static Predicate eq(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2) {
return eq( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 )
return eq( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 )
);
}
@ -129,8 +126,7 @@ public class GeolatteSpatialPredicates {
Expression<? extends Geometry> geometry2) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( ST_CONTAINS.name(), boolean.class,
geometry1, geometry2
criteriaBuilder.function( ST_CONTAINS.name(), boolean.class, geometry1, geometry2
)
);
}
@ -149,8 +145,7 @@ public class GeolatteSpatialPredicates {
public static Predicate contains(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2) {
return contains( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 )
return contains( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 )
);
}
@ -170,8 +165,7 @@ public class GeolatteSpatialPredicates {
Expression<? extends Geometry> geometry2) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( ST_CROSSES.name(), boolean.class,
geometry1, geometry2
criteriaBuilder.function( ST_CROSSES.name(), boolean.class, geometry1, geometry2
)
);
}
@ -229,9 +223,7 @@ public class GeolatteSpatialPredicates {
public static Predicate disjoint(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2) {
return disjoint( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 )
);
return disjoint( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 ) );
}
/**
@ -365,9 +357,7 @@ public class GeolatteSpatialPredicates {
Expression<? extends Geometry> geometry2) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( SpatialFunction.filter.toString(), boolean.class,
geometry1, geometry2
)
criteriaBuilder.function( SpatialFunction.filter.toString(), boolean.class, geometry1, geometry2 )
);
}
@ -429,8 +419,12 @@ public class GeolatteSpatialPredicates {
Expression<? extends Geometry> geometry2, Expression<Double> distance) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( SpatialFunction.dwithin.toString(), boolean.class,
geometry1, geometry2, distance
criteriaBuilder.function(
SpatialFunction.dwithin.toString(),
boolean.class,
geometry1,
geometry2,
distance
)
);
}
@ -450,8 +444,7 @@ public class GeolatteSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2, Expression<Double> distance) {
return distanceWithin( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 ), distance
return distanceWithin( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 ), distance
);
}
@ -470,8 +463,11 @@ public class GeolatteSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2, double distance) {
return distanceWithin( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 ), criteriaBuilder.literal( distance )
return distanceWithin(
criteriaBuilder,
geometry1,
criteriaBuilder.literal( geometry2 ),
criteriaBuilder.literal( distance )
);
}
@ -490,8 +486,7 @@ public class GeolatteSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Expression<? extends Geometry> geometry2, double distance) {
return distanceWithin( criteriaBuilder, geometry1, geometry2,
criteriaBuilder.literal( distance )
return distanceWithin( criteriaBuilder, geometry1, geometry2, criteriaBuilder.literal( distance )
);
}
@ -529,9 +524,7 @@ public class GeolatteSpatialPredicates {
public static Predicate havingSRID(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry,
int srid) {
return havingSRID( criteriaBuilder, geometry,
criteriaBuilder.literal( srid )
);
return havingSRID( criteriaBuilder, geometry, criteriaBuilder.literal( srid ) );
}
/**
@ -547,9 +540,7 @@ public class GeolatteSpatialPredicates {
public static Predicate isEmpty(CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( SpatialFunction.isempty.toString(), boolean.class,
geometry
)
criteriaBuilder.function( SpatialFunction.isempty.toString(), boolean.class, geometry )
);
}

View File

@ -10,7 +10,6 @@ import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import org.hibernate.NotYetImplementedFor6Exception;
import org.hibernate.spatial.SpatialFunction;
import org.locationtech.jts.geom.Geometry;
@ -136,9 +135,7 @@ public class JTSSpatialPredicates {
public static Predicate contains(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2) {
return contains( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 )
);
return contains( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 ) );
}
/**
@ -155,9 +152,7 @@ public class JTSSpatialPredicates {
Expression<? extends Geometry> geometry2) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( ST_CROSSES.name(), boolean.class,
geometry1, geometry2
)
criteriaBuilder.function( ST_CROSSES.name(), boolean.class, geometry1, geometry2 )
);
}
@ -212,9 +207,7 @@ public class JTSSpatialPredicates {
public static Predicate disjoint(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2) {
return disjoint( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 )
);
return disjoint( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 ) );
}
/**
@ -326,7 +319,6 @@ public class JTSSpatialPredicates {
}
// /**
// * Create a predicate for testing the arguments for bounding box overlap constraint.
// *
@ -399,8 +391,12 @@ public class JTSSpatialPredicates {
Expression<? extends Geometry> geometry2, Expression<Double> distance) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( SpatialFunction.dwithin.toString(), boolean.class,
geometry1, geometry2, distance
criteriaBuilder.function(
SpatialFunction.dwithin.toString(),
boolean.class,
geometry1,
geometry2,
distance
)
);
}
@ -420,9 +416,7 @@ public class JTSSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2, Expression<Double> distance) {
return distanceWithin( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 ), distance
);
return distanceWithin( criteriaBuilder, geometry1, criteriaBuilder.literal( geometry2 ), distance );
}
/**
@ -440,8 +434,11 @@ public class JTSSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Geometry geometry2, double distance) {
return distanceWithin( criteriaBuilder, geometry1,
criteriaBuilder.literal( geometry2 ), criteriaBuilder.literal( distance )
return distanceWithin(
criteriaBuilder,
geometry1,
criteriaBuilder.literal( geometry2 ),
criteriaBuilder.literal( distance )
);
}
@ -460,9 +457,7 @@ public class JTSSpatialPredicates {
public static Predicate distanceWithin(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry1,
Expression<? extends Geometry> geometry2, double distance) {
return distanceWithin( criteriaBuilder, geometry1, geometry2,
criteriaBuilder.literal( distance )
);
return distanceWithin( criteriaBuilder, geometry1, geometry2, criteriaBuilder.literal( distance ) );
}
/**
@ -497,9 +492,7 @@ public class JTSSpatialPredicates {
public static Predicate havingSRID(
CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry,
int srid) {
return havingSRID( criteriaBuilder, geometry,
criteriaBuilder.literal( srid )
);
return havingSRID( criteriaBuilder, geometry, criteriaBuilder.literal( srid ) );
}
/**
@ -513,9 +506,7 @@ public class JTSSpatialPredicates {
public static Predicate isEmpty(CriteriaBuilder criteriaBuilder, Expression<? extends Geometry> geometry) {
return booleanExpressionToPredicate(
criteriaBuilder,
criteriaBuilder.function( SpatialFunction.isempty.toString(), boolean.class,
geometry
)
criteriaBuilder.function( SpatialFunction.isempty.toString(), boolean.class, geometry )
);
}