apache / apache/grails-core

Allow setting the base parameter of indexColumn

Open
#14,663 0 comments 0 reactions 0 assignees View on GitHub
relates-to: grails-data-hibernate5
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

Hibernate allows a [`base` attribute](https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch07.html#collections-indexed) (or `@ListIndexBase` annotation) for List collections, to map legacy databases having the list index starting from 1.

I couldn't find a way to do the same in Grails. I believe it should be added to the ColumnConfig class and then to the code producing the Hibernate mapping.

Contributor guide

Open the contributing guide

Research direction

Start by locating ColumnConfig and the code producing the Hibernate mapping for indexed List collections. Read how indexColumn is currently configured, then trace the generated mapping and compare it with Hibernate's base attribute or @ListIndexBase support. Done means Grails can configure a nonzero list-index base for legacy databases and the generated mapping reflects that setting.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.