diff --git a/src/main/java/sirius/biz/storage/layer2/jdbc/SQLBlobStorageSpace.java b/src/main/java/sirius/biz/storage/layer2/jdbc/SQLBlobStorageSpace.java index 1429583b6..746507c8e 100644 --- a/src/main/java/sirius/biz/storage/layer2/jdbc/SQLBlobStorageSpace.java +++ b/src/main/java/sirius/biz/storage/layer2/jdbc/SQLBlobStorageSpace.java @@ -31,6 +31,7 @@ import sirius.kernel.commons.Files; import sirius.kernel.commons.Strings; import sirius.kernel.commons.Tuple; +import sirius.kernel.commons.Value; import sirius.kernel.di.std.Part; import sirius.kernel.health.Exceptions; import sirius.kernel.nls.NLS; @@ -661,7 +662,7 @@ protected void listChildDirectories(SQLDirectory parent, .eq(SQLDirectory.COMMITTED, true) .eq(SQLDirectory.DELETED, false) .where(OMA.FILTERS.like(SQLDirectory.NORMALIZED_DIRECTORY_NAME) - .startsWith(prefixFilter) + .startsWith(Value.of(prefixFilter).toLowerCase()) .ignoreEmpty() .build()) .limit(maxResults) diff --git a/src/main/java/sirius/biz/storage/layer2/jdbc/SQLDirectory.java b/src/main/java/sirius/biz/storage/layer2/jdbc/SQLDirectory.java index dcd4b712f..fd82f00ce 100644 --- a/src/main/java/sirius/biz/storage/layer2/jdbc/SQLDirectory.java +++ b/src/main/java/sirius/biz/storage/layer2/jdbc/SQLDirectory.java @@ -20,6 +20,7 @@ import sirius.db.mixing.annotations.BeforeSave; import sirius.db.mixing.annotations.Index; import sirius.db.mixing.annotations.Length; +import sirius.db.mixing.annotations.LowerCase; import sirius.db.mixing.annotations.NullAllowed; import sirius.db.mixing.annotations.Transient; import sirius.db.mixing.types.BaseEntityRef; @@ -76,6 +77,7 @@ public class SQLDirectory extends SQLEntity implements Directory, OptimisticCrea */ public static final Mapping NORMALIZED_DIRECTORY_NAME = Mapping.named("normalizedDirectoryName"); @Length(255) + @LowerCase @NullAllowed private String normalizedDirectoryName; @@ -131,7 +133,7 @@ protected void beforeSave() { if (Strings.isFilled(directoryName)) { this.directoryName = storageUtils.sanitizePath(directoryName); if (Strings.isFilled(directoryName)) { - this.normalizedDirectoryName = directoryName.toLowerCase(); + this.normalizedDirectoryName = directoryName; } else { this.directoryName = null; this.normalizedDirectoryName = null; diff --git a/src/main/java/sirius/biz/storage/layer2/mongo/MongoDirectory.java b/src/main/java/sirius/biz/storage/layer2/mongo/MongoDirectory.java index e3067816a..af2d7568f 100644 --- a/src/main/java/sirius/biz/storage/layer2/mongo/MongoDirectory.java +++ b/src/main/java/sirius/biz/storage/layer2/mongo/MongoDirectory.java @@ -17,6 +17,7 @@ import sirius.db.mixing.Mapping; import sirius.db.mixing.annotations.BeforeSave; import sirius.db.mixing.annotations.Index; +import sirius.db.mixing.annotations.LowerCase; import sirius.db.mixing.annotations.NullAllowed; import sirius.db.mixing.annotations.Transient; import sirius.db.mixing.types.BaseEntityRef; @@ -78,6 +79,7 @@ public class MongoDirectory extends MongoEntity implements Directory, Optimistic */ public static final Mapping NORMALIZED_DIRECTORY_NAME = Mapping.named("normalizedDirectoryName"); @NullAllowed + @LowerCase private String normalizedDirectoryName; /** @@ -131,7 +133,7 @@ protected void beforeSave() { if (Strings.isFilled(directoryName)) { this.directoryName = storageUtils.sanitizePath(directoryName); if (Strings.isFilled(directoryName)) { - this.normalizedDirectoryName = directoryName.toLowerCase(); + this.normalizedDirectoryName = directoryName; } else { this.directoryName = null; this.normalizedDirectoryName = null;