org.springframework.boot.orm.jpa.hibernate

Class SpringNamingStrategy

  • java.lang.Object
    • org.hibernate.cfg.ImprovedNamingStrategy
      • org.springframework.boot.orm.jpa.hibernate.SpringNamingStrategy
  • All Implemented Interfaces:
    Serializable, org.hibernate.cfg.NamingStrategy


    public class SpringNamingStrategy
    extends org.hibernate.cfg.ImprovedNamingStrategy
    Hibernate NamingStrategy that follows Spring recommended naming conventions. Naming conventions implemented here are identical to ImprovedNamingStrategy with the exception that foreign key columns include the referenced column name.
    Since:
    1.2.0
    Author:
    Phillip Webb
    See Also:
    "https://stackoverflow.com/questions/7689206/ejb3namingstrategy-vs-improvednamingstrategy-foreign-key-naming", Serialized Form
    • Constructor Detail

      • SpringNamingStrategy

        public SpringNamingStrategy()
    • Method Detail

      • foreignKeyColumnName

        public String foreignKeyColumnName(String propertyName,
                                           String propertyEntityName,
                                           String propertyTableName,
                                           String referencedColumnName)
        Specified by:
        foreignKeyColumnName in interface org.hibernate.cfg.NamingStrategy
        Overrides:
        foreignKeyColumnName in class org.hibernate.cfg.ImprovedNamingStrategy

Copyright © 2019 Pivotal Software, Inc.. All rights reserved.