This is the bean,
public boolean paid;
public boolean isPaid()
{
return paid;
}
public void setPaid(boolean paid)
{
this.paid=paid;
}
But when i create an object to save in database like,
CourseFee fee=new CourseFee();
fee.setPaid(false);
hibernateTemplate.save(fee);
I get the following exception,
java.sql.BatchUpdateException: Data too long for column ‘paid’ at row 1
Which is the correct way to set boolean values in hibernate?
Try using big
Booleanin your POJO class.Or try updating your mapping like this:
Thanks.