I had problems to use the @Embedded Annotation with the previous solution from:
26
This solution does not "flatten" the attributes, instead it keeps the "normal" java model hierarchy.
So @Embeddable Annotations behave like @ManyToOne and @OneToOne Annotations.
The query looks like that:
Spaceship (id: "1000"){ name, created { user {id}}, modified {date} }
where "created" and "modified" are of Typ DateAndUser, which is a @Embeddable Class
@Embeddable public class DateAndUser { public Date date; @ManyToOne public User user; }
Hi,
I had problems to use the @Embedded Annotation with the previous solution from:
26
This solution does not "flatten" the attributes, instead it keeps the "normal" java model hierarchy. So @Embeddable Annotations behave like @ManyToOne and @OneToOne Annotations.
The query looks like that:
Spaceship (id: "1000"){ name, created { user {id}}, modified {date} }
where "created" and "modified" are of Typ DateAndUser, which is a @Embeddable Class
@Embeddable public class DateAndUser { public Date date; @ManyToOne public User user; }