Ensure that a Redis key prefix is specified
This commit is contained in:
parent
4bd23c365d
commit
d837f1e99b
@ -29,7 +29,10 @@ public class RedisRepository<ID, E> extends Repository<Redis, ID, E> {
|
|||||||
|
|
||||||
public RedisRepository(@NonNull Redis database, @NonNull Class<? extends E> entityClass, @NonNull String keyPrefix) {
|
public RedisRepository(@NonNull Redis database, @NonNull Class<? extends E> entityClass, @NonNull String keyPrefix) {
|
||||||
super(database, entityClass);
|
super(database, entityClass);
|
||||||
this.keyPrefix = keyPrefix;
|
this.keyPrefix = keyPrefix.trim();
|
||||||
|
if (this.keyPrefix.isEmpty()) { // Missing a key prefix
|
||||||
|
throw new IllegalArgumentException("Missing key prefix");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user