public class DefaultNamingStrategy extends Object implements NamingStrategy
split
the Java name according to the Java convention, and then
join
the resulting tokens according to the Cassandra
convention. For example, a possible implementation might:
Constructor and Description |
---|
DefaultNamingStrategy()
Builds a new instance with the default conventions, namely
lower camel case
for the Java convention, and
lower case
for the Cassandra convention. |
DefaultNamingStrategy(NamingConvention javaConvention,
NamingConvention cassandraConvention)
Builds a new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
toCassandraName(String javaPropertyName)
Infers a Cassandra column/field name from a Java property name.
|
public DefaultNamingStrategy()
lower camel case
for the Java convention, and
lower case
for the Cassandra convention.
For example, a "userName" Java property will be mapped to a "username" column.public DefaultNamingStrategy(NamingConvention javaConvention, NamingConvention cassandraConvention)
javaConvention
- the naming convention that will be used to tokenize the Java
property names.cassandraConvention
- the naming convention that will be used to build the Cassandra
names from the Java tokens.public String toCassandraName(String javaPropertyName)
NamingStrategy
toCassandraName
in interface NamingStrategy
javaPropertyName
- the name of the Java property. Depending on the
property access strategy
, this might the name of the Java field, or
be inferred from a getter/setter based on the usual Java beans
conventions.Copyright © 2012–2018. All rights reserved.