During deploying my app I occurs on that exception. I have a lot of class in my app and I dont know where I must to place @IdClass and what does this exception
@IdClass annotation is used to define the Class that contains the id. i.e. This is generally used in case defining a compound key. i.e. a key composite of more than one attribute.
If that is the case, than this is how we do. take a look at following example.. we define a class as IdClass and use @Id's to define varrious Ids for thisIdClass`.
Example :
@Entity
@IdClass(AssignedRoleId.class)
public class AssignedRole
{
@Id
@ManyToOne
private User userId;
@Id
@ManyToOne
private Role roleId;
private Date dateAssigned;
}
Hope this helps.