I have an Entity and a related IdClass.
@Entity
@IdClass(MyEntityId.class)
class MyEntity {
@Id @ManyToOne You you; <---------------------|
@Id @ManyToOne He he; ------------------------+---------|
} | |
| @@? |
class MyEntityId { | | @@?
Long you; <-----------------------------------| |
Long he; <----------------------------------------------|
}
Is it OK without any MapsId or something?
Does JPA automatically maps you to you and he to he?
The types must match. I.e. they should be
Longin your entity. Apart from that – yes, they are matched by name.