I am using below code run a query with Join
@Transactional
public Result<Record> getFolderFeeList(int argFolderRSN, String argOrderBy) {
Transaction transaction = Transaction.current();
// List<ValidAccountFeeRow> validSiteOptionList = transaction.daos().getValidAccountFeeDao().findAll();
SelectQuery<Record> selectQuery = transaction.selectQuery();
selectQuery.addSelect(
Routines.fFoldername(argFolderRSN).as("FolderName"),
AccountBillFee.ACCOUNT_BILL_FEE.FOLDER_RSN,
AccountBillFee.ACCOUNT_BILL_FEE.PARENT_ACCOUNT_BILL_FEE_RSN,
AccountBillFee.ACCOUNT_BILL_FEE.FEE_CODE,
AccountBillFee.ACCOUNT_BILL_FEE.PROCESS_RSN,
AccountBillFee.ACCOUNT_BILL_FEE.SECURITY_CODE,
AccountBillFee.ACCOUNT_BILL_FEE.FEE_AMOUNT,
Routines.fGetpaidinfullflag(AccountBillFee.ACCOUNT_BILL_FEE.BILL_NUMBER, AccountBill.ACCOUNT_BILL.PAYMENT_OPTION,
AccountBillFee.ACCOUNT_BILL_FEE.FEE_LEFT.cast(Double.class), AccountBill.ACCOUNT_BILL.PAID_IN_FULL_FLAG.cast(String.class))
.as("PaidInFullFlag"), AccountBillFee.ACCOUNT_BILL_FEE.MANDATORY_FLAG, AccountBill.ACCOUNT_BILL.DUE_DATE,
AccountBillFee.ACCOUNT_BILL_FEE.BILL_NUMBER, AccountBillFee.ACCOUNT_BILL_FEE.ACCOUNT_BILL_FEE_RSN,
AccountBillFee.ACCOUNT_BILL_FEE.FEE_COMMENT);
selectQuery.addFrom(AccountBillFee.ACCOUNT_BILL_FEE);
selectQuery.addJoin(AccountBill.ACCOUNT_BILL, JoinType.LEFT_OUTER_JOIN,
AccountBill.ACCOUNT_BILL.BILL_NUMBER.eq(AccountBillFee.ACCOUNT_BILL_FEE.BILL_NUMBER));
selectQuery.addJoin(ValidAccountFee.VALID_ACCOUNT_FEE,
AccountBillFee.ACCOUNT_BILL_FEE.FEE_CODE.eq(ValidAccountFee.VALID_ACCOUNT_FEE.FEE_CODE));
selectQuery.addConditions(AccountBillFee.ACCOUNT_BILL_FEE.FOLDER_RSN.eq(argFolderRSN));
if (argOrderBy == null) {
selectQuery.addOrderBy(AccountBillFee.ACCOUNT_BILL_FEE.FOLDER_RSN.asc(), AccountBillFee.ACCOUNT_BILL_FEE.BILL_NUMBER.asc(),
AccountBillFee.ACCOUNT_BILL_FEE.FEE_CODE.asc());
} else {
// To Do selectQuery.addOrderBy(argOrderBy);
}
Result<Record> result = selectQuery.fetch();
return result;
}
Now is it pssible somehow this query will return me AccountBillFee table whole object as well as functions values? As i saw in JOOQ if i am creating a object by my self its always inserting a new record rather than updating it.