hello,
i'm just testing ibatis with abator for my application.
i got a table called odm_bill
ID NOT NULL NUMBER
AMOUNT NUMBER(22,2)
STATE VARCHAR2(31)
DATE_CREATED DATE
DATE_MATURE DATE
DATE_PAYED DATE
PAYMENT_TRANSACTION_DATA VARCHAR2(2047)
HASH_KEY NOT NULL VARCHAR2(20)
URL VARCHAR2(511)
CONFIRM_URL VARCHAR2(1023)
defining the map like this in abator.xml:
<table schema="c108272dev" tableName="ODM_BILL">
<generatedKey identity="false" column="id"
sqlStatement="SELECT c108272dev.ODM_BILL_COUNTER.nextval AS id FROM dual"
/>
<columnOverride column="id"
javaType="java.lang.Long" />
</table>
first using the abator generated OdmBillDao (billDao) then like this:
public Boolean setBillState(OdmBill bill, String state) {
log("updating bill: id: " + bill.getId());
bill.setState(state);
int numRows = billDao.updateByPrimaryKey(bill);
if (numRows != 1)
return false;
return true;
}
then i tried like this:
public Boolean setBillState(OdmBill bill, String state) {
log("updating bill: id: " + bill.getId());
bill.setState(state);
daoManager.startTransaction();
int numRows = billDao.updateByPrimaryKey(bill);
daoManager.commitTransaction();
daoManager.endTransaction();
if (numRows != 1)
return false;
return true;
}
it all seems to work at the first look (if i try to get the value eg
with: getBillById...) , but the value seems never to be
updated in the database.
same thing with a insert statement.
i can insert a bill, query it, but if i have a look at the database, its
not there.
what am i doing wrong?
is there a method i have to call to syncronize with db?
greets
tom.