-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
What steps will reproduce the problem ?
Steps to reproduce the behavior:
- Create an entity class with appropriate structure that has inner static class that's used as
@EmbeddedId
; - Build the project to see the graph is generated
What is the expected output ?
Graphs for entity and composed entity id are generated
What happens instead ?
Build failed. Graph is not generated. Issue: package CompositeIdEntityGraph does not exists
in CustomEntityGraph
Environment
- spring-boot-starter-data-jpa: 3.5.4
- hibernate-core: 6.6.22.Final
- spring-data-jpa-entity-graph: 3.5.0
Additional context
Real case example:
@Entity
@Setter
public class Custom {
@EmbeddedId
CompositeId id;
@ManyToOne
@MapsId("firstObjectId")
@JoinColumn(...)
FirstObject fo;
@ManyToOne
@MapsId("seconfObjectId")
@JoinColumn(...)
SecondObject so;
@Embeddable
@Getter
public static class CompositeId implements Serializable {
UUID firstObjectId;
UUID seconfObjectId;
}
}
WA: It works if class is not static and placed outside it's root
entity.
According to documentation, static classes are allowed to be used with @Embedded/@Embeddable
annotations
https://docs.jboss.org/hibernate/orm/7.1/userguide/html_single/Hibernate_User_Guide.html#_component_embedded
Metadata
Metadata
Assignees
Labels
No labels