Fix /lp search query (#972)

This commit is contained in:
Luck 2018-05-05 18:39:13 +01:00
parent 7ee9b93365
commit 022b385c0a
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
4 changed files with 13 additions and 3 deletions

View File

@ -69,4 +69,9 @@ public class Constraint {
public String getExpression() {
return this.expression;
}
@Override
public String toString() {
return this.comparison + " " + this.expression;
}
}

View File

@ -94,6 +94,11 @@ public enum StandardComparison implements Comparison {
builder.append(this.asSql);
}
@Override
public String toString() {
return this.symbol;
}
public static StandardComparison parseComparison(String s) {
for (StandardComparison t : values()) {
if (t.getSymbol().equals(s)) {

View File

@ -118,7 +118,7 @@ public enum Message {
TREE_EMPTY("&cUnable to generate tree. No results were found.", true),
TREE_URL("&aPermission tree URL:", true),
SEARCH_SEARCHING("&aSearching for users and groups with &b{}&a...", true),
SEARCH_SEARCHING("&aSearching for users and groups with &bpermissions {}&a...", true),
SEARCH_SEARCHING_MEMBERS("&aSearching for users and groups who inherit from &b{}&a...", true),
SEARCH_RESULT("&aFound &b{}&a entries from &b{}&a users and &b{}&a groups.", true),

View File

@ -83,7 +83,7 @@ public class SqlDao extends AbstractDao {
private static final String USER_PERMISSIONS_DELETE = "DELETE FROM {prefix}user_permissions WHERE uuid=?";
private static final String USER_PERMISSIONS_INSERT = "INSERT INTO {prefix}user_permissions(uuid, permission, value, server, world, expiry, contexts) VALUES(?, ?, ?, ?, ?, ?, ?)";
private static final String USER_PERMISSIONS_SELECT_DISTINCT = "SELECT DISTINCT uuid FROM {prefix}user_permissions";
private static final String USER_PERMISSIONS_SELECT_PERMISSION = "SELECT uuid, permission, value, server, world, expiry, contexts FROM {prefix}user_permissions WHERE";
private static final String USER_PERMISSIONS_SELECT_PERMISSION = "SELECT uuid, permission, value, server, world, expiry, contexts FROM {prefix}user_permissions WHERE ";
private static final String PLAYER_SELECT_UUID_BY_USERNAME = "SELECT uuid FROM {prefix}players WHERE username=? LIMIT 1";
private static final String PLAYER_SELECT_USERNAME_BY_UUID = "SELECT username FROM {prefix}players WHERE uuid=? LIMIT 1";
@ -99,7 +99,7 @@ public class SqlDao extends AbstractDao {
private static final String GROUP_PERMISSIONS_DELETE = "DELETE FROM {prefix}group_permissions WHERE name=?";
private static final String GROUP_PERMISSIONS_DELETE_SPECIFIC = "DELETE FROM {prefix}group_permissions WHERE name=? AND permission=? AND value=? AND server=? AND world=? AND expiry=? AND contexts=?";
private static final String GROUP_PERMISSIONS_INSERT = "INSERT INTO {prefix}group_permissions(name, permission, value, server, world, expiry, contexts) VALUES(?, ?, ?, ?, ?, ?, ?)";
private static final String GROUP_PERMISSIONS_SELECT_PERMISSION = "SELECT name, permission, value, server, world, expiry, contexts FROM {prefix}group_permissions WHERE";
private static final String GROUP_PERMISSIONS_SELECT_PERMISSION = "SELECT name, permission, value, server, world, expiry, contexts FROM {prefix}group_permissions WHERE ";
private static final String GROUP_SELECT_ALL = "SELECT name FROM {prefix}groups";
private static final String MYSQL_GROUP_INSERT = "INSERT INTO {prefix}groups (name) VALUES(?) ON DUPLICATE KEY UPDATE name=name";