JPA - Can an @JoinColumn be an @Id as well? SerializationException occurs.
- by Shivago
Hi everyone,
I am trying to use an @JoinColumn as an @Id using JPA and I am getting SerializationExceptions, "Could not serialize."
UserRole.java:
@Entity
@Table(name = "authorities")
public class UserRole implements Serializable {
@Column(name = "authority")
private String role;
@Id
@ManyToOne
@JoinColumn(name = "username")
private…