Im tryingto understand the code shown below
Criteria criteria = session.createCriteria(Payables.class);
criteria.add(Restrictions.eq("companyId", companyId));
criteria.createAlias("makePayment", "makePayment");
if (creditorId != null) {
criteria.createAlias("makePayment.creditor", "creditor");
criteria.add(Restrictions.eq("creditor.id", creditorId));
}
criteria.add(Restrictions.eq("journalEntryId", journalEntryId));
I do know what createCriteria do, but adding createAlias makes it really confusing for me. I've already read the documentations but everything's still a blur.
Could you tell me how does the code above looks like using mysql statement?