Skip to content

JPA Mapping Composite ID #14494

Open
Open

Description

@felixscheinost

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

Add a domain like in this commented out test case:

https://github.com/grails/grails-data-mapping/blob/f1158a73b4127a7aab41608e4ae6e0804079e544/grails-datastore-core/src/test/groovy/org/grails/datastore/mapping/model/JpaMappingSyntaxTests.groovy#L386-L393

Expected Behaviour

The project should compile.

Actual Behaviour

The project fails to compile with the following error(s):

[...].groovy: -1: The method public java.lang.Long getId()  { ... } duplicates another method of the same signature
[...].groovy:: -1: Repetitive method name/signature for method 'java.lang.Long getId()' in class '[...]'
[...].groovy:: -1: Repetitive method name/signature for method 'java.lang.Long getId()' in class '[...]'

Environment Information

  • Operating System: macOS 10.15.7
  • GORM Version: 7.0.4
  • Grails Version (if using Grails): 4.0.3
  • JDK Version: 8

Activity

  1. borinquenkid commented on Nov 14, 2026

    @borinquenkid
    Member

    Fixed by #16990 (7.0.x): an entity with several @Id properties no longer gets getId() generated twice, so it compiles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions