public long updateTPersonBorrower(TPersonBorrower tPersonBorrower, TJobBorrower tJobBorrower) { long result = tPersonBorrowerDao.update(tPersonBorrower); if (result <= 0) { throw new ZeroSQLException(); } TJobBorrower tJobBorrowerModel = tJobBorrowerDao.getTJobBorrowerByPersonId(tPersonBorrower.getId()); tJobBorrower.setId(tJobBorrowerModel.getId()); result = tJobBorrowerDao.update(tJobBorrower); if (result <= 0) { throw new ZeroSQLException(); } return result; }
public long addTPersonBorrower(TPersonBorrower tPersonBorrower, TJobBorrower tJobBorrower) { long result = tPersonBorrowerDao.insert(tPersonBorrower); if (result <= 0) { throw new ZeroSQLException(); } tJobBorrower.setPersonBorrowerId(tPersonBorrower.getId()); result = tJobBorrowerDao.insert(tJobBorrower); if (result <= 0) { throw new ZeroSQLException(); } return result; }