I'm new in Hibernate and Groovy, i dont know why i got error id in this code. My Grails version is 2.1.1
Grails-app/Domain using Hibernate
class Deposit implements Validateable{
BigInteger **id**
BigDecimal amount
BigDecimal currentBalance
static mapping = {
datasource 'test'
table 'DEPOSIT'
id column: "ID"
amount column: "amount"
currentBalance column: "currentBalance"
version false
}
DepositContoller
def depositTrx(){
def savedata = new Deposit()
savedata.id=3;
savedata.amount=122223;
savedata.currentBalance=1511122;
savedata.save()
redirect(uri: "/Deposit")
}
if I use id in grails-app/Domain, i got this error: batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
when I change grails-app/Domain: id become to ide or whatever, the code successfully save data to database, but page show me this error null id in Deposit entry (don't flush the Session after an exception occurs)
def saveData = Deposit.load(3)
? – erichelgeson