Search in sources :

Example 6 with Criterion

use of org.hibernate.criterion.Criterion in project hibernate-orm by hibernate.

the class TestSpatialRestrictions method intersects.

@Test
public void intersects() throws SQLException {
    if (!isSupportedByDialect(SpatialFunction.intersects)) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getIntersects(expectationsFactory.getTestPolygon());
    Criterion spatialCriterion = SpatialRestrictions.intersects("geom", expectationsFactory.getTestPolygon());
    retrieveAndCompare(dbexpected, spatialCriterion);
}
Also used : Criterion(org.hibernate.criterion.Criterion) Test(org.junit.Test)

Example 7 with Criterion

use of org.hibernate.criterion.Criterion in project hibernate-orm by hibernate.

the class TestSpatialRestrictions method overlaps.

@Test
public void overlaps() throws SQLException {
    if (!isSupportedByDialect(SpatialFunction.overlaps)) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getOverlaps(expectationsFactory.getTestPolygon());
    Criterion spatialCriterion = SpatialRestrictions.overlaps("geom", expectationsFactory.getTestPolygon());
    retrieveAndCompare(dbexpected, spatialCriterion);
}
Also used : Criterion(org.hibernate.criterion.Criterion) Test(org.junit.Test)

Example 8 with Criterion

use of org.hibernate.criterion.Criterion in project hibernate-orm by hibernate.

the class TestSpatialRestrictions method dwithin.

@Test
public void dwithin() throws SQLException {
    if (!isSupportedByDialect(SpatialFunction.dwithin)) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getDwithin(expectationsFactory.getTestPoint(), 30.0);
    Criterion spatialCriterion = SpatialRestrictions.distanceWithin("geom", expectationsFactory.getTestPoint(), 30.0);
    retrieveAndCompare(dbexpected, spatialCriterion);
}
Also used : Criterion(org.hibernate.criterion.Criterion) Test(org.junit.Test)

Example 9 with Criterion

use of org.hibernate.criterion.Criterion in project hibernate-orm by hibernate.

the class TestSpatialRestrictions method crosses.

@Test
public void crosses() throws SQLException {
    if (!isSupportedByDialect(SpatialFunction.crosses)) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getCrosses(expectationsFactory.getTestPolygon());
    Criterion spatialCriterion = SpatialRestrictions.crosses("geom", expectationsFactory.getTestPolygon());
    retrieveAndCompare(dbexpected, spatialCriterion);
}
Also used : Criterion(org.hibernate.criterion.Criterion) Test(org.junit.Test)

Example 10 with Criterion

use of org.hibernate.criterion.Criterion in project hibernate-orm by hibernate.

the class TestSpatialRestrictions method filter.

@Test
public void filter() throws SQLException {
    if (!dialectSupportsFiltering()) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getFilter(expectationsFactory.getTestPolygon());
    Criterion spatialCriterion = SpatialRestrictions.filter("geom", expectationsFactory.getTestPolygon());
    retrieveAndCompare(dbexpected, spatialCriterion);
}
Also used : Criterion(org.hibernate.criterion.Criterion) Test(org.junit.Test)

Aggregations

Criterion (org.hibernate.criterion.Criterion)27 Test (org.junit.Test)15 ArrayList (java.util.ArrayList)7 List (java.util.List)6 RootMap (com.cosylab.cdb.jdal.hibernate.RootMap)5 HashMap (java.util.HashMap)5 LinkedHashMap (java.util.LinkedHashMap)5 LinkedList (java.util.LinkedList)5 Map (java.util.Map)5 Session (org.hibernate.Session)5 Criteria (org.hibernate.Criteria)4 Field (java.lang.reflect.Field)3 Method (java.lang.reflect.Method)3 Component (alma.acs.tmcdb.Component)2 Container (alma.acs.tmcdb.Container)2 Comparator (java.util.Comparator)2 IrrelevantEntity (org.hibernate.IrrelevantEntity)2 SessionFactory (org.hibernate.SessionFactory)2 Configuration (org.hibernate.cfg.Configuration)2 DetachedCriteria (org.hibernate.criterion.DetachedCriteria)2