Skip to content

Commit

Permalink
OGM-1542 Add test case for select disitnct on entity
Browse files Browse the repository at this point in the history
  Example: SELECT(DISTINCT a) FROM Author a
  • Loading branch information
DavideD committed Dec 16, 2018
1 parent 05aceaf commit 7d2e0ca
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -52,6 +52,14 @@ public void shouldCountEntities() {
} );
}

@Test
public void shouldCountDistinctEntities() {
inTransaction( em -> {
Number result = (Number) em.createQuery( "SELECT COUNT(DISTINCT author) FROM Author author" ).getSingleResult();
assertThat( result.intValue() ).isEqualTo( 4 );
} );
}

@Test
public void shouldCountByName() {
inTransaction( em -> {
Expand Down

0 comments on commit 7d2e0ca

Please sign in to comment.