I'm trying to join a table with 2 conditions, userId and guideId are the same in both tables.
@OneToOne(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "user_id",insertable =false, updatable = false)
@Where(clause = "guide_id = guide_id") <-- this isn't working
@LazyCollection(LazyCollectionOption.FALSE)
@NotFound(action = NotFoundAction.IGNORE)
private UserInvite userInvite;
Is this the right way to go about it?
I found some documentation around filters but this seems like an overkill. Is there a simple solution using the Where annotation?