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

The following examples show how to use org.jdbi.v3.sqlobject.statement.SqlQuery. 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 File: SessionPropertiesDao.java    From presto with 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 #2
Source File: VerifierDao.java    From presto with 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 #3
Source File: ResourceGroupsDao.java    From presto with 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 File: ResourceGroupsDao.java    From presto with 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 File: TestcaseDAO.java    From irontest with 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 #6
Source File: UserDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select id, username, salt from user where id = :id")
User findById(@Bind("id") long id);
 
Example #7
Source File: TestcaseRunDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from testcase_run where id = :id")
TestcaseRun _findById(@Bind("id") long id);
 
Example #8
Source File: EnvironmentDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from environment")
List<Environment> findAll();
 
Example #9
Source File: UserDefinedPropertyDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from udp where id = :id")
UserDefinedProperty findById(@Bind("id") long id);
 
Example #10
Source File: TestcaseIndividualRunDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from testcase_individualrun where testcase_run_id = :testcaseRunId")
List<TestcaseIndividualRun> _findByTestcaseRunId(@Bind("testcaseRunId") long testcaseRunId);
 
Example #11
Source File: UtilsDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select TRIM(CHAR(0) FROM UTF8TOSTRING(DECRYPT('AES', '" + ENDPOINT_PASSWORD_ENCRYPTION_KEY + "', :encryptedPassword)))")
String decryptEndpointPassword(@Bind("encryptedPassword") String encryptedPassword);
 
Example #12
Source File: AssertionDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from assertion where teststep_id = :teststepId")
List<Assertion> findByTeststepId(@Bind("teststepId") long teststepId);
 
Example #13
Source File: TestcaseDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from testcase where id = :id")
Testcase _findById(@Bind("id") long id);
 
Example #14
Source File: TeststepDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select request from teststep where id = :teststepId")
@RegisterColumnMapper(ObjectColumnMapper.class)
Object getBinaryRequestById(@Bind("teststepId") long teststepId);
 
Example #15
Source File: TeststepDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select api_request from teststep where id = :teststepId")
@RegisterColumnMapper(APIRequestColumMapper.class)
APIRequest getAPIRequestById(@Bind("teststepId") long teststepId);
 
Example #16
Source File: DataTableColumnDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from datatable_column where testcase_id = :testcaseId order by sequence")
List<DataTableColumn> findByTestcaseId(@Bind("testcaseId") long testcaseId);
 
Example #17
Source File: TeststepRunDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from teststep_run where id = :id")
TeststepRun findById(@Bind("id") long id);
 
Example #18
Source File: CooldownMariaDBProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>cooldowns")
@RegisterRowMapper(CooldownRowMapper.class)
List<Cooldown> getAllCooldowns(@Define("prefix") @NotNull String prefix);
 
Example #19
Source File: UserDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select id, username from user")
List<User> findAll();
 
Example #20
Source File: PropertyExtractorDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select testcase_id from teststep where id = (select teststep_id from property_extractor where id = :id)")
long findTestcaseIdById(@Bind("id") long id);
 
Example #21
Source File: FolderDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from folder where id = :id")
Folder _findById(@Bind("id") long id);
 
Example #22
Source File: FolderTreeNodeDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select id as id_per_type, name as text, parent_folder_id, 'folder' as type from folder " +
        "union " +
        "select id as id_per_type, name as text, parent_folder_id, 'testcase' as type from testcase")
List<FolderTreeNode> findAll();
 
Example #23
Source File: EndpointDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select id, environment_id, name, type, description from endpoint where environment_id = :environmentId")
List<Endpoint> findByEnvironmentId_EnvironmentEditView(@Bind("environmentId") long environmentId);
 
Example #24
Source File: EndpointDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery(
        "select ep.*, ev.name as environment_name " +
        "from endpoint ep left outer join environment ev on ep.environment_id = ev.id " +
        "where ep.id = :id")
Endpoint findById(@Bind("id") long id);
 
Example #25
Source File: DataTableCellDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from datatable_cell where column_id = :columnId order by row_sequence")
List<DataTableCell> findByColumnId(@Bind("columnId") long columnId);
 
Example #26
Source File: CooldownSQLiteProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>cooldowns")
@RegisterRowMapper(CooldownRowMapper.class)
List<Cooldown> getAllCooldowns(@Define("prefix") @NotNull String prefix);
 
Example #27
Source File: TeststepRunDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from teststep_run where testcase_run_id = :testcaseRunId")
List<TeststepRun> findByTestcaseRunId(@Bind("testcaseRunId") long testcaseRunId);
 
Example #28
Source File: CooldownMySQLProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT * FROM <prefix>cooldowns")
@RegisterRowMapper(CooldownRowMapper.class)
List<Cooldown> getAllCooldowns(@Define("prefix") @NotNull String prefix);
 
Example #29
Source File: CooldownMySQLProvider.java    From Guilds with MIT License 4 votes vote down vote up
@Override
@SqlQuery("SELECT EXISTS(SELECT 1 FROM <prefix>cooldowns WHERE type = :type AND owner = :owner)")
boolean cooldownExists(@Define("prefix") @NotNull String tablePrefix, @NotNull @Bind("type") String cooldownType, @NotNull @Bind("owner") String cooldownOwner) throws IOException;
 
Example #30
Source File: ArticleDAO.java    From irontest with Apache License 2.0 4 votes vote down vote up
@SqlQuery("select * from article")
List<Article> findAll();