DATAKV-268 - Polishing.

Add test for non annotation driven keyspace resolution and update documentation.

Original Pull Request: #46
This commit is contained in:
Christoph Strobl
2019-06-24 13:55:16 +02:00
parent 07d2b8c015
commit a73dda0736
3 changed files with 22 additions and 7 deletions

View File

@@ -55,9 +55,11 @@ public class BasicKeyValuePersistentEntity<T, P extends KeyValuePersistentProper
String keySpace = AnnotationBasedKeySpaceResolver.INSTANCE.resolveKeySpace(type);
if (StringUtils.hasText(keySpace)) {
this.keyspace = keySpace;
this.keyspaceExpression = detectExpression(keySpace);
} else {
this.keyspace = resolveKeyspace(fallbackKeySpaceResolver, type);
this.keyspaceExpression = null;
}
@@ -67,8 +69,8 @@ public class BasicKeyValuePersistentEntity<T, P extends KeyValuePersistentProper
* Returns a SpEL {@link Expression} if the given {@link String} is actually an expression that does not evaluate to a
* {@link LiteralExpression} (indicating that no subsequent evaluation is necessary).
*
* @param potentialExpression can be {@literal null}
* @return
* @param potentialExpression must not be {@literal null}
* @return the parsed {@link Expression} or {@literal null}.
*/
@Nullable
private static Expression detectExpression(String potentialExpression) {