Java Code Examples for org.jdbi.v3.sqlobject.customizer.Define

The following examples show how to use org.jdbi.v3.sqlobject.customizer.Define. 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: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>guild (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 2
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>guild (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 3
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>guild (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 4
Source Project: Guilds   Source File: ChallengeMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>challenge (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 5
Source Project: Guilds   Source File: ChallengeMySQLProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>challenge (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 6
Source Project: Guilds   Source File: ChallengeSQLiteProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>challenge (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 7
Source Project: Guilds   Source File: ArenaMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>arena (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 8
Source Project: Guilds   Source File: ArenaMySQLProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>arena (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `data` JSON NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 9
Source Project: Guilds   Source File: CooldownMariaDBProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>cooldowns (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `type` VARCHAR(36) NOT NULL,\n" +
                "  `owner` VARCHAR(36) NOT NULL,\n" +
                "  `expiry` TIMESTAMP NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 10
Source Project: Guilds   Source File: CooldownMySQLProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>cooldowns (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `type` VARCHAR(36) NOT NULL,\n" +
                "  `owner` VARCHAR(36) NOT NULL,\n" +
                "  `expiry` TIMESTAMP NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 11
Source Project: Guilds   Source File: CooldownSQLiteProvider.java    License: MIT License 5 votes vote down vote up
@Override
@SqlUpdate(
        "CREATE TABLE IF NOT EXISTS <prefix>cooldowns (\n" +
                "  `id` VARCHAR(36) NOT NULL,\n" +
                "  `type` VARCHAR(36) NOT NULL,\n" +
                "  `owner` VARCHAR(36) NOT NULL,\n" +
                "  `expiry` TIMESTAMP NOT NULL,\n" +
                "  PRIMARY KEY (`id`),\n" +
                "  UNIQUE (`id`));"
)
void createContainer(@Define("prefix") @NotNull String prefix);
 
Example 12
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 13
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 14
Source Project: Guilds   Source File: CooldownSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("DELETE FROM <prefix>cooldowns WHERE type = :type AND owner = :owner")
void deleteCooldown(@Define("prefix") @NotNull String prefix, @NotNull @Bind("type") String type, @NotNull @Bind("owner") String owner) throws IOException;
 
Example 15
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 16
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>guild(id, data) VALUES (:id, :data)")
void createGuild(@Define("prefix") @NotNull String prefix, @Bind("id") String id, @Bind("data") String data);
 
Example 17
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("UPDATE <prefix>guild SET data = :data WHERE id = :id")
void updateGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id, @Bind("data") @NotNull String data) throws IOException;
 
Example 18
Source Project: Guilds   Source File: GuildSQLiteProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("DELETE FROM <prefix>guild WHERE id = :id")
void deleteGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 19
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 20
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 21
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 22
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 23
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>guild(id, data) VALUES (:id, :data)")
void createGuild(@Define("prefix") @NotNull String prefix, @Bind("id") String id, @Bind("data") String data);
 
Example 24
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("UPDATE <prefix>guild SET data = :data WHERE id = :id")
void updateGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id, @Bind("data") @NotNull String data) throws IOException;
 
Example 25
Source Project: Guilds   Source File: GuildMySQLProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("DELETE FROM <prefix>guild WHERE id = :id")
void deleteGuild(@Define("prefix") @NotNull String prefix, @Bind("id") @NotNull String id) throws IOException;
 
Example 26
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 27
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 28
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 29
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 30
Source Project: Guilds   Source File: GuildMariaDBProvider.java    License: MIT License 4 votes vote down vote up
@Override
@SqlUpdate("INSERT INTO <prefix>guild(id, data) VALUES (:id, :data)")
void createGuild(@Define("prefix") @NotNull String prefix, @Bind("id") String id, @Bind("data") String data);