File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble running example from Hibernate Made Easy, p. 156

 
Matthew Busse
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic