I need to make a join using criteria, in entity mapped "one to one"
example:
public class Item {
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "transcation_id")
private Transaction transaction;
private String status;
...
...
}
public class Transaction {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
...
...
}
my query is based on the entity "Transaction", however I want to get the attribute "status" of Entity "Item"
I need to do something like this in my method:
predicates.add(root.join("?????").get("????").in("STATUS_OK"));