use of org.apache.cayenne.exp.Expression in project cayenne by apache.
the class SelectQueryClobIT method testSelectEqualsClob.
@Test
public void testSelectEqualsClob() throws Exception {
if (accessStackAdapter.supportsLobComparisons()) {
createClobDataSet();
SelectQuery<ClobTestEntity> query = new SelectQuery<ClobTestEntity>(ClobTestEntity.class);
Expression qual = ExpressionFactory.matchExp("clobCol", "clob1");
query.setQualifier(qual);
List<?> objects = context.performQuery(query);
assertEquals(1, objects.size());
}
}
use of org.apache.cayenne.exp.Expression in project cayenne by apache.
the class SelectQueryClobIT method testSelectNotEqualsClob.
@Test
public void testSelectNotEqualsClob() throws Exception {
if (accessStackAdapter.supportsLobComparisons()) {
createClobDataSet();
SelectQuery query = new SelectQuery(ClobTestEntity.class);
Expression qual = ExpressionFactory.noMatchExp("clobCol", "clob1");
query.setQualifier(qual);
List<?> objects = context.performQuery(query);
assertEquals(1, objects.size());
}
}
use of org.apache.cayenne.exp.Expression in project cayenne by apache.
the class SelectQueryIT method testSelectNotLikeSingleWildcardMatch.
@Test
public void testSelectNotLikeSingleWildcardMatch() throws Exception {
createArtistsDataSet();
SelectQuery<Artist> query = new SelectQuery<>(Artist.class);
Expression qual = ExpressionFactory.notLikeExp("artistName", "artist11%");
query.setQualifier(qual);
List<?> objects = context.performQuery(query);
assertEquals(19, objects.size());
}
use of org.apache.cayenne.exp.Expression in project cayenne by apache.
the class SelectQueryIT method testSelectLikeCaseSensitive.
/**
* SQL Server failure:
* http://stackoverflow.com/questions/14962419/is-the-like-operator-case-sensitive-with-ms-sql-server
*/
@Test
public void testSelectLikeCaseSensitive() throws Exception {
if (!accessStackAdapter.supportsCaseSensitiveLike()) {
return;
}
createArtistsDataSet();
SelectQuery<Artist> query = new SelectQuery<>(Artist.class);
Expression qual = ExpressionFactory.likeExp("artistName", "aRtIsT%");
query.setQualifier(qual);
List<?> objects = context.performQuery(query);
assertEquals(0, objects.size());
}
use of org.apache.cayenne.exp.Expression in project cayenne by apache.
the class SelectQueryIT method testSelectEmptyIn.
@Test
public void testSelectEmptyIn() throws Exception {
createArtistsDataSet();
SelectQuery<Artist> query = new SelectQuery<>(Artist.class);
Expression qual = ExpressionFactory.inExp("artistName");
query.setQualifier(qual);
List<?> objects = context.performQuery(query);
assertEquals(0, objects.size());
}
Aggregations