profile
viewpoint

Ask questionsDefault the Naming Strategy for Hibernate to snake case (lower case, underscore separated)

micronaut 1.2.0 micronaut-data 1.0.0.BUILD-SNAPSHOT

Database is migrated with flyway.

I'm getting the following exception when using a repository: Postgres

Caused by: org.postgresql.util.PSQLException: ERROR: column user0_.firstname does not exist
  Hint: Perhaps you meant to reference the column "user0_.first_name".

H2

Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "USER0_.FIRSTNAME" not found; SQL statement:
select user0_.id as id1_0_, user0_.email as email2_0_, user0_.firstName as firstNam3_0_ from accounts_user user0_ [42122-199]

Example repository: https://github.com/lucasmogari/micronaut-data-naming-strategy

micronaut-projects/micronaut-data

Answer questions lucasmogari

This worked.

jpa:
  default:
    properties:
      hibernate:
        physical_naming_strategy: "io.micronaut.data.hibernate.naming.DefaultPhysicalNamingStrategy"
useful!
source:https://uonfu.com/
Github User Rank List