Java Code Examples for org.jdbi.v3.sqlobject.statement.SqlQuery

The following examples show how to use org.jdbi.v3.sqlobject.statement.SqlQuery. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: presto   Source File: VerifierDao.java    License: Apache License 2.0 6 votes vote down vote up
@SqlQuery("" +
        "SELECT\n" +
        "  suite\n" +
        ", name\n" +
        ", test_catalog\n" +
        ", test_schema\n" +
        ", test_prequeries\n" +
        ", test_query\n" +
        ", test_postqueries\n" +
        ", test_username\n" +
        ", test_password\n" +
        ", control_catalog\n" +
        ", control_schema\n" +
        ", control_prequeries\n" +
        ", control_query\n" +
        ", control_postqueries\n" +
        ", control_username\n" +
        ", control_password\n" +
        ", session_properties_json\n" +
        "FROM verifier_queries\n" +
        "WHERE suite = :suite\n" +
        "ORDER BY id\n" +
        "LIMIT :limit")
@UseRowMapper(QueryPairMapper.class)
List<QueryPair> getQueriesBySuite(@Bind("suite") String suite, @Bind("limit") int limit);
 
Example 2
Source Project: presto   Source File: SessionPropertiesDao.java    License: Apache License 2.0 6 votes vote down vote up
@SqlQuery("SELECT " +
        "S.spec_id,\n" +
        "S.user_regex,\n" +
        "S.source_regex,\n" +
        "S.query_type,\n" +
        "S.group_regex,\n" +
        "S.client_tags,\n" +
        "GROUP_CONCAT(P.session_property_name ORDER BY P.session_property_name) session_property_names,\n" +
        "GROUP_CONCAT(P.session_property_value ORDER BY P.session_property_name) session_property_values\n" +
        "FROM\n" +
        "(SELECT\n" +
        "A.spec_id, A.user_regex, A.source_regex, A.query_type, A.group_regex, A.priority,\n" +
        "GROUP_CONCAT(DISTINCT B.client_tag) client_tags\n" +
        "FROM " + SESSION_SPECS_TABLE + " A\n" +
        "LEFT JOIN " + CLIENT_TAGS_TABLE + " B\n" +
        "ON A.spec_id = B.tag_spec_id\n" +
        "GROUP BY A.spec_id, A.user_regex, A.source_regex, A.query_type, A.group_regex, A.priority)\n" +
        " S JOIN\n" +
        PROPERTIES_TABLE + " P\n" +
        "ON S.spec_id = P.property_spec_id\n" +
        "GROUP BY S.spec_id, S.user_regex, S.source_regex, S.query_type, S.group_regex, S.priority, S.client_tags\n" +
        "ORDER BY S.priority asc")
@UseRowMapper(SessionMatchSpec.Mapper.class)
List<SessionMatchSpec> getSessionMatchSpecs();
 
Example 3
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlQuery("SELECT resource_group_id, name, soft_memory_limit, max_queued, soft_concurrency_limit, " +
        "  hard_concurrency_limit, scheduling_policy, scheduling_weight, jmx_export, soft_cpu_limit, " +
        "  hard_cpu_limit, parent\n" +
        "FROM resource_groups\n" +
        "WHERE environment = :environment\n")
@UseRowMapper(ResourceGroupSpecBuilder.Mapper.class)
List<ResourceGroupSpecBuilder> getResourceGroups(@Bind("environment") String environment);
 
Example 4
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 5 votes vote down vote up
@SqlQuery("SELECT S.resource_group_id, S.priority, S.user_regex, S.source_regex, S.query_type, S.client_tags, S.selector_resource_estimate\n" +
        "FROM selectors S\n" +
        "JOIN resource_groups R ON (S.resource_group_id = R.resource_group_id)\n" +
        "WHERE R.environment = :environment\n" +
        "ORDER by priority DESC")
@UseRowMapper(SelectorRecord.Mapper.class)
List<SelectorRecord> getSelectors(@Bind("environment") String environment);
 
Example 5
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns the most specific exact-match selector for a given environment, source and query type.
 * NULL values in the environment and query type fields signify wildcards.
 */
@SqlQuery("SELECT resource_group_id\n" +
        "FROM exact_match_source_selectors\n" +
        "WHERE source = :source\n" +
        "  AND (environment = :environment OR environment IS NULL)\n" +
        "  AND (query_type = :query_type OR query_type IS NULL)\n" +
        "ORDER BY environment IS NULL, query_type IS NULL\n" +
        "LIMIT 1")
String getExactMatchResourceGroup(
        @Bind("environment") String environment,
        @Bind("source") String source,
        @Bind("query_type") String queryType);
 
Example 6
Source Project: irontest   Source File: TestcaseDAO.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @param testcaseId
 * @return folder path of the testcase
 */
@SqlQuery("WITH RECURSIVE T(parent_folder_id, path) AS (" +
              "SELECT parent_folder_id, name AS path " +
              "FROM folder WHERE id = (SELECT parent_folder_id FROM testcase WHERE id = :testcaseId) " +
              "UNION ALL " +
              "SELECT T2.parent_folder_id, (T2.name || '/' || T.path) AS path " +
              "FROM T INNER JOIN folder AS T2 ON T.parent_folder_id = T2.id " +
          ") SELECT path FROM T WHERE parent_folder_id IS NULL")
String getFolderPath(@Bind("testcaseId") long testcaseId);
 
Example 7
Source Project: presto   Source File: ResourceGroupsDao.java    License: Apache License 2.0 4 votes vote down vote up
@SqlQuery("SELECT value FROM resource_groups_global_properties WHERE name = 'cpu_quota_period'")
@UseRowMapper(ResourceGroupGlobalProperties.Mapper.class)
List<ResourceGroupGlobalProperties> getResourceGroupGlobalProperties();
 
Example 8
Source Project: micronaut-sql   Source File: TestInterface.java    License: Apache License 2.0 4 votes vote down vote up
@SqlQuery("SELECT COUNT(*) FROM foo")
@Transaction
Integer count();
 
Example 9
Source Project: irontest   Source File: UserDefinedPropertyDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from udp where testcase_id = :testcaseId order by sequence")
List<UserDefinedProperty> findByTestcaseId(@Bind("testcaseId") long testcaseId);
 
Example 10
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>guild WHERE id = :id)")
boolean guildExists(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 11
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT id FROM <prefix>guild")
List<String> getAllGuildIds(@Define("prefix") @NotNull String tablePrefix) throws IOException;
 
Example 12
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild")
@RegisterRowMapper(GuildRowMapper.class)
List<Guild> getAllGuilds(@Define("prefix") @NotNull String prefix);
 
Example 13
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild WHERE id = :id")
@RegisterRowMapper(GuildRowMapper.class)
Guild getGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 14
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>guild WHERE id = :id)")
boolean guildExists(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 15
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT id FROM <prefix>guild")
List<String> getAllGuildIds(@Define("prefix") @NotNull String tablePrefix) throws IOException;
 
Example 16
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild")
@RegisterRowMapper(GuildRowMapper.class)
List<Guild> getAllGuilds(@Define("prefix") @NotNull String prefix);
 
Example 17
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild WHERE id = :id")
@RegisterRowMapper(GuildRowMapper.class)
Guild getGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 18
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>guild WHERE id = :id)")
boolean guildExists(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 19
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT id FROM <prefix>guild")
List<String> getAllGuildIds(@Define("prefix") @NotNull String tablePrefix) throws IOException;
 
Example 20
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild")
@RegisterRowMapper(GuildRowMapper.class)
List<Guild> getAllGuilds(@Define("prefix") @NotNull String prefix);
 
Example 21
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>guild WHERE id = :id")
@RegisterRowMapper(GuildRowMapper.class)
Guild getGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 22
Source Project: irontest   Source File: TeststepRunDAO.java    License: Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from teststep_run where testcase_individualrun_id = :testcaseIndividualRunId")
List<TeststepRun> findByTestcaseIndividualRunId(@Bind("testcaseIndividualRunId") long testcaseIndividualRunId);
 
Example 23
Source Project: Guilds   Source File: ChallengeMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge")
@RegisterRowMapper(ChallengeRowMapper.class)
List<GuildChallenge> getAllChallenges(@Define("prefix") @NotNull String prefix);
 
Example 24
Source Project: Guilds   Source File: ChallengeMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge WHERE id = :id")
@RegisterRowMapper(ChallengeRowMapper.class)
GuildChallenge getChallenge(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 25
Source Project: Guilds   Source File: ChallengeMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>challenge WHERE id = :id)")
boolean challengeExists(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 26
Source Project: Guilds   Source File: ChallengeMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge")
@RegisterRowMapper(ChallengeRowMapper.class)
List<GuildChallenge> getAllChallenges(@Define("prefix") @NotNull String prefix);
 
Example 27
Source Project: Guilds   Source File: ChallengeMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge WHERE id = :id")
@RegisterRowMapper(ChallengeRowMapper.class)
GuildChallenge getChallenge(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 28
Source Project: Guilds   Source File: ChallengeSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>challenge WHERE id = :id)")
boolean challengeExists(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 29
Source Project: Guilds   Source File: ChallengeSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge")
@RegisterRowMapper(ChallengeRowMapper.class)
List<GuildChallenge> getAllChallenges(@Define("prefix") @NotNull String prefix);
 
Example 30
Source Project: Guilds   Source File: ChallengeSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>challenge WHERE id = :id")
@RegisterRowMapper(ChallengeRowMapper.class)
GuildChallenge getChallenge(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;