Skip to content

processAot fails when ImplicitNamingStrategyComponentPathImpl is used #4092

@coder966

Description

@coder966

When there's an entity which has more than one field with the same name, but they are in different embeddable classes, example:

@Entity
@Getter
@Setter
@ToString
public class Example {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    private Personal personal;
    private Business business;

    @Embeddable
    @Getter
    @Setter
    @ToString
    public static class Personal {
        private String address;
    }

    @Embeddable
    @Getter
    @Setter
    @ToString
    public static class Business {
        private String address;
    }

}

the task processAot fails with this error:

Caused by: org.hibernate.MappingException: Column 'address' is duplicated in mapping for entity 'com.example.Example' (use '@Column(insertable=false, updatable=false)' when mapping multiple properties to the same column)

However, this should not happen since

spring.jpa.hibernate.naming.implicit-strategy is set to org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions