Created
March 5, 2015 16:15
-
-
Save fge/06f05266d0de4d99c5a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public MatchesData getMatchesData() | |
| { | |
| final Field<Integer> emptyMatches = DSL.decode() | |
| .when(EMPTY_MATCHES_CONDITION, 1).otherwise(0); | |
| final Field<Integer> nonEmptyMatches = DSL.decode() | |
| .when(NONEMPTY_MATCHES_CONDITION, 1).otherwise(0); | |
| final Field<Integer> failedMatches = DSL.decode() | |
| .when(FAILED_MATCHES_CONDITION, 1).otherwise(0); | |
| return jooq.select(MATCHERS.NAME, MATCHERS.MATCHER_TYPE, | |
| MATCHERS.CLASS_NAME, | |
| DSL.sum(emptyMatches).as("emptyMatches"), | |
| DSL.sum(nonEmptyMatches).as("nonEmptyMatches"), | |
| DSL.sum(failedMatches).as("failedMatches")) | |
| .from(MATCHERS, NODES) | |
| .where(MATCHERS.ID.eq(NODES.MATCHER_ID)) | |
| .groupBy(MATCHERS.NAME, MATCHERS.MATCHER_TYPE, MATCHERS.CLASS_NAME) | |
| .fetch().stream() | |
| .map(MATCH_STATISTICS_MAPPER::map) | |
| .collect(MatchesData.asCollector()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment