Class DefaultNamingStrategy
java.lang.Object
org.springframework.data.relational.core.mapping.DefaultNamingStrategy
- All Implemented Interfaces:
NamingStrategy
The default naming strategy used by Spring Data Relational. Names are in
SNAKE_CASE
.- Since:
- 3.0
- Author:
- Jens Schauder
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetReverseColumnName
(RelationalPersistentEntity<?> parent) For a reference A -> B this is the name in the table for B which references A.void
setForeignKeyNaming
(ForeignKeyNaming foreignKeyNaming) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.relational.core.mapping.NamingStrategy
getColumnName, getKeyColumn, getSchema, getTableName
-
Field Details
-
INSTANCE
Static immutable instance of the class. It is made immutable by lettingsetForeignKeyNaming(ForeignKeyNaming)
throw an exception.Using this avoids creating essentially the same class over and over again.
-
-
Constructor Details
-
DefaultNamingStrategy
public DefaultNamingStrategy()
-
-
Method Details
-
setForeignKeyNaming
-
getReverseColumnName
Description copied from interface:NamingStrategy
For a reference A -> B this is the name in the table for B which references A.- Specified by:
getReverseColumnName
in interfaceNamingStrategy
- Parameters:
property
- The property whose column name in the owner table is required- Returns:
- a column name. Must not be
null
.
-
getReverseColumnName
- Specified by:
getReverseColumnName
in interfaceNamingStrategy
-
getReverseColumnName
- Specified by:
getReverseColumnName
in interfaceNamingStrategy
-