| Author |
Trouble running example from Hibernate Made Easy, p. 156
|
Matthew Busse
Ranch Hand
Joined: Sep 29, 2010
Posts: 52
|
|
Hello Ranchers,
I'm working my way through the Hibernate Made Easy book, and it's been great so far, but I'm stuck on the example on p.156.
When I try to run the User class, I get this error: "java.sql.SQLException: Data too long for column 'verified' at row 1"
Here's my code, I checked it several times to make sure I didn't miss anything:
I don't understand by Boolean.FALSE is too big to fit in verified column.
Thanks!
Matt
|
 |
Oliver Chua
Greenhorn
Joined: Feb 27, 2004
Posts: 29
|
|
Hi,
In your log4j.properties, add this
so you can see the sql statements
I've tried recreating the problem but it worked fine for me.
Below are the log entries when creating the table and inserting a record
CREATE TABLE "Individual_Simple_Entity1"
(
"ID" NUMBER(19,0) NOT NULL ENABLE,
"BOOLEANFIELD" NUMBER(1,0) NOT NULL ENABLE,
PRIMARY KEY ("ID") ENABLE
)
insert into Individual_Simple_Entity1 (booleanField, id) values (?, ?)
binding 'true' to parameter: 1
binding '1' to parameter: 2
in the db, the value of booleanField becomes 1
|
 |
Liu Xing
Greenhorn
Joined: Jul 19, 2010
Posts: 12
|
|
Oliver Chua wrote:Hi,
In your log4j.properties, add this
so you can see the sql statements
I've tried recreating the problem but it worked fine for me.
Below are the log entries when creating the table and inserting a record
CREATE TABLE "Individual_Simple_Entity1"
(
"ID" NUMBER(19,0) NOT NULL ENABLE,
"BOOLEANFIELD" NUMBER(1,0) NOT NULL ENABLE,
PRIMARY KEY ("ID") ENABLE
)
insert into Individual_Simple_Entity1 (booleanField, id) values (?, ?)
binding 'true' to parameter: 1
binding '1' to parameter: 2
in the db, the value of booleanField becomes 1
Thank you very much.
You are quite right.
|
 |
 |
|
|
subject: Trouble running example from Hibernate Made Easy, p. 156
|
|
|