jakartaee / persistence

https://jakartaee.github.io/persistence/
Other
191 stars 55 forks source link

EmbeddedId bad column ordering, and AttributeOverride does not have any effect on EmbeddedId #422

Closed Guarmanda closed 12 months ago

Guarmanda commented 1 year ago

An EmbeddedId in an entity creates the id columns at the END of the table, wich is very bad. Adding AttributeOverride to an EmbeddedId will not have any effect, nor on the column name neither on the column ordering

@Embeddable
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
private static class SquadPersonneId {
    private Long idPersonne;
    private Long idSquad;
}

@EmbeddedId
@AttributeOverride(name = "idPersonne", column = @Column(name = "id_personne"))
@AttributeOverride(name = "idSquad", column = @Column(name = "id_squad", insertable = false, updatable = false))
private SquadPersonneId id;

//other columns

image

gavinking commented 1 year ago

This does not appear to be an issue with the JPA spec, which has nothing to say about column ordering, and seems to be about some specific implementation.

Is it fine if I close this?

gavinking commented 12 months ago

No response, so I'm closing. (Anyway it's simply not an issue for the spec.)