public interface NamingStrategy
Class and column
name based on property names.
NOTE: Can also be used as an adapter. Create a lambda or an anonymous subclass and override any settings to implement a different strategy on the fly.
| Modifier and Type | Field and Description |
|---|---|
static NamingStrategy |
INSTANCE
Empty implementation of the interface utilizing only the default implementation.
|
static NamingStrategy |
SNAKE_CASE
Naming strategy that renders CamelCase name parts to
snake_case. |
| Modifier and Type | Method and Description |
|---|---|
default String |
getColumnName(CassandraPersistentProperty property)
Create a column name from the given
property. |
default String |
getTableName(CassandraPersistentEntity<?> entity)
Create a table name from the given
CassandraPersistentEntity. |
default String |
getUserDefinedTypeName(CassandraPersistentEntity<?> entity)
Create a user-defined type name from the given
CassandraPersistentEntity. |
default NamingStrategy |
transform(UnaryOperator<String> mappingFunction)
Apply a
transformation function to create a new NamingStrategy
that applies the given transformation to each name component. |
static final NamingStrategy INSTANCE
Using this avoids creating essentially the same class over and over again.
static final NamingStrategy SNAKE_CASE
snake_case.default String getTableName(CassandraPersistentEntity<?> entity)
CassandraPersistentEntity.default String getUserDefinedTypeName(CassandraPersistentEntity<?> entity)
CassandraPersistentEntity.default String getColumnName(CassandraPersistentProperty property)
property.default NamingStrategy transform(UnaryOperator<String> mappingFunction)
transformation function to create a new NamingStrategy
that applies the given transformation to each name component.
Example:
NamingStrategy lower = NamingStrategy.INSTANCE.transform(String::toLowerCase);
mappingFunction - must not be null.NamingStrategy that applies the given transformation function.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.