Changing name of association column name
- Dominant language
- Groovy
- Stars
- 2.9k
- Forks
- 975
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 92
Description
In app I am working on we already have tables where columns are named in camel case (for example "userId"). And dont want to add column name in mapping for each association in domain.
Currently, default behavior for naming columns for associations is just to add "_id" which is set [here](https://github.com/grails/gorm-hibernate5/blob/master/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L82)
So is it possible to make `FOREIGN_KEY_SUFFIX` configurable, that will be great, or at least not `final protected` so it can be changed?
Contributor guide
Research direction
Start with grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java and inspect how FOREIGN_KEY_SUFFIX is used when association columns are generated. Trace the configuration and mapping entry points to determine where a configurable suffix could be supported, with completion meaning camel-case association columns work without per-association column mappings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100