| There's a typo in the query. Instead of:
root.join("finances").join("selectedAmount");
there should be:
root.join("finances").join("selectedAccount");
Because the Finances class has a selectedAccount property and not a selectedAmount one.
@Embeddable
public class Finances {
@OneToOne(cascade = CascadeType.PERSIST) Account selectedAccount;
}
After I made this change the test runs fine. |