Skip to content

Commit

Permalink
configured test for different DB
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-nikitko committed Aug 9, 2023
1 parent f87a1e8 commit 18a78ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ public void testInNull() {
*/
@Test
public void testSelectWithScalarAsWhereCondition() {
if (adapter.supportScalarAsExpression()){
return;
}
ObjectSelect<Artist> objectSelect = ObjectSelect.query(Artist.class).where(ExpressionFactory.wrapScalarValue("abc"));
CayenneRuntimeException exception = assertThrows(CayenneRuntimeException.class, () -> objectSelect.select(context));
assertTrue(exception.getMessage().contains("Query exception."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,9 @@ public boolean supportsGeneratedKeysAdd() {
public boolean supportsGeneratedKeysDrop() {
return true;
}

@Override
public boolean supportScalarAsExpression() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,12 @@ public boolean supportsLongIn() {
public boolean supportsNullComparison() {
return true;
}

/**
* Support for select like this:
* SELECT t0.ARTIST_NAME FROM ARTIST t0 WHERE 'abc'
*/
public boolean supportScalarAsExpression(){
return false;
}
}

0 comments on commit 18a78ba

Please sign in to comment.