Class OnnoNamingStrategy

java.lang.Object
su.onno.spring.OnnoNamingStrategy
All Implemented Interfaces:
org.springframework.data.relational.core.mapping.NamingStrategy

public class OnnoNamingStrategy extends Object implements org.springframework.data.relational.core.mapping.NamingStrategy
  • Constructor Details

    • OnnoNamingStrategy

      public OnnoNamingStrategy()
    • OnnoNamingStrategy

      public OnnoNamingStrategy(Map<Class<?>,String> tabularSectionTables)
  • Method Details

    • getTableName

      public String getTableName(Class<?> type)
      Specified by:
      getTableName in interface org.springframework.data.relational.core.mapping.NamingStrategy
    • getColumnName

      public String getColumnName(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property)
      Specified by:
      getColumnName in interface org.springframework.data.relational.core.mapping.NamingStrategy
    • getReverseColumnName

      public String getReverseColumnName(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property)
      Specified by:
      getReverseColumnName in interface org.springframework.data.relational.core.mapping.NamingStrategy
    • getReverseColumnName

      public String getReverseColumnName(org.springframework.data.relational.core.mapping.RelationalPersistentEntity<?> owner)
      The back-reference column on a tabular-section child table. Spring Data JDBC resolves the reverse column through this RelationalPersistentEntity overload (see BasicRelationalPersistentProperty#getReverseColumnName(RelationalPersistentEntity)), not the property overload above — so this one must also return _parent_id for the mapping to match the generated schema. The only owned collections in this framework are tabular sections, so an unconditional _parent_id is correct.
      Specified by:
      getReverseColumnName in interface org.springframework.data.relational.core.mapping.NamingStrategy
    • getKeyColumn

      public String getKeyColumn(org.springframework.data.relational.core.mapping.RelationalPersistentProperty property)
      Specified by:
      getKeyColumn in interface org.springframework.data.relational.core.mapping.NamingStrategy