Package io.micronaut.data.model.naming
Interface NamingStrategy
- All Known Implementing Classes:
NamingStrategies.KebabCase
,NamingStrategies.LowerCase
,NamingStrategies.Raw
,NamingStrategies.UnderScoreSeparatedLowerCase
,NamingStrategies.UnderScoreSeparatedUpperCase
,NamingStrategies.UpperCase
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A strategy interface for resolving the mapped name of an entity or property.
- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NamingStrategy
Constant for the default under score separated lower case strategy. -
Method Summary
Modifier and TypeMethodDescriptiondefault String
The default foreign key suffix for property names.default String
mappedJoinTableColumn
(PersistentEntity associated, List<Association> associations, PersistentProperty property) default String
mappedName
(Association association) Return the mapped name for the given association.default String
mappedName
(Embedded embedded, PersistentProperty property) Return the mapped name given anEmbedded
association and the property of the association.default String
mappedName
(PersistentEntity entity) Return the mapped name for the given entity.default String
mappedName
(PersistentProperty property) Return the mapped name for the given property.mappedName
(String name) Return the mapped name for the given name.default String
mappedName
(List<Association> associations, PersistentProperty property)
-
Field Details
-
DEFAULT
Constant for the default under score separated lower case strategy.
-
-
Method Details
-
mappedName
Return the mapped name for the given name.- Parameters:
name
- The name- Returns:
- The mapped name
-
mappedName
Return the mapped name for the given entity.- Parameters:
entity
- The entity- Returns:
- The mapped name
-
mappedName
Return the mapped name given anEmbedded
association and the property of the association. The default strategy takes the parent embedded property name and combines it underscore separated with the child parent property name.For example given:
@Embedded Address address;
Where the
Address
type has a property calledstreet
then a name ofaddress_street
will be returned- Parameters:
embedded
- The embedded parentproperty
- The embedded property- Returns:
- The mapped name
-
mappedName
Return the mapped name for the given property.- Parameters:
property
- The property- Returns:
- The mapped name
-
mappedName
Return the mapped name for the given association.- Parameters:
association
- The association- Returns:
- The mapped name
-
mappedName
@NonNull default String mappedName(@NonNull List<Association> associations, @NonNull PersistentProperty property) -
mappedJoinTableColumn
default String mappedJoinTableColumn(PersistentEntity associated, List<Association> associations, PersistentProperty property) -
getForeignKeySuffix
The default foreign key suffix for property names.- Returns:
- The suffix
-