Search in sources :

Example 21 with Criterion

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

the class TestSpatialRestrictions method touches.

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

Example 22 with Criterion

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

the class TestSpatialRestrictions method disjoint.

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

Example 23 with Criterion

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

the class TestSpatialRestrictions method within.

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

Example 24 with Criterion

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

the class TestSpatialRestrictions method eq.

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

Example 25 with Criterion

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

the class TestSpatialRestrictions method isNotEmpty.

@Test
public void isNotEmpty() throws SQLException {
    if (!isSupportedByDialect(SpatialFunction.isempty)) {
        return;
    }
    Map<Integer, Boolean> dbexpected = expectationsFactory.getIsNotEmpty();
    Criterion spatialCriterion = SpatialRestrictions.isNotEmpty("geom");
    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