diff --git a/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java b/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java index 4c2f732..0c7f7eb 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java +++ b/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java @@ -479,6 +479,18 @@ public abstract class SQLElement> { public static final SQLType TEXT = new SQLType<>("TEXT", String.class); public static final SQLType STRING = TEXT; + public static final SQLType BINARY(int byteCount) { + if (byteCount <= 0) throw new IllegalArgumentException("byteCount must be positive."); + return new SQLType<>("BINARY(" + byteCount + ")", byte[].class); + } + + public static final SQLType VARBINARY(int byteCount) { + if (byteCount <= 0) throw new IllegalArgumentException("byteCount must be positive."); + return new SQLType<>("VARBINARY(" + byteCount + ")", byte[].class); + } + + public static final SQLType BLOB = new SQLType<>("BLOB", byte[].class); + public static final > SQLType ENUM(Class enumType) { if (enumType == null) throw new IllegalArgumentException("enumType can't be null."); String enumStr = "'"; @@ -495,6 +507,4 @@ public abstract class SQLElement> { } public static final SQLType CHAR36_UUID = new SQLCustomType<>(CHAR(36), UUID.class, UUID::fromString, UUID::toString); - - }