micronaut-projects / micronaut-projects/micronaut-data

Micronaut-data not honoring NamingStrategy

Open
#860 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug type: docs
Dominant language
Java
Stars
482
Forks
229
Avg merge
1d 7h
Merged PRs (30d)
32

Description

Thanks for reporting an issue, please review the task list below before submitting the
issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.

Task List
  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)
Steps to Reproduce

Hello Team,
I am trying to override NamingStrategy for Entities using documentation https://micronaut-projects.github.io/micronaut-data/2.2.1/guide/index.html#sqlNaming . I used @MappedEntity(namingStrategy = NamingStrategies.Raw.class) but my table and column names are still created in snake_case . My Sample project :- https://github.com/abhikumarblume/namingStrategyDemo

  1. Bring-up the sample micronaut gradle project https://github.com/abhikumarblume/namingStrategyDemo
  2. DB tables would be created.
Expected Behaviour

Table and column name should match attribute names.

Actual Behaviour

Table and column names are created in snake_case,

Environment Information
  • Operating System: windows
  • Micronaut Version: 2.2.1
  • JDK Version: java 8
Example Application

https://github.com/abhikumarblume/namingStrategyDemo

image

image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by bringing up the linked namingStrategyDemo Micronaut Gradle project and inspect the entity using @MappedEntity(namingStrategy = NamingStrategies.Raw.class). Compare the generated database table and column names with the entity attribute names. Done means the configured raw naming strategy is honored rather than producing snake_case names.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.