Hi I am a beginner of spring/hibernate (3.0) and postgres (8.0.3), and I ran into a strange problem.
I am just trying to insert to a table (called "groups", which has id (int), name and description which are both char). id is auto-generated sequence.
so from the jsp page, I input "aname" and "adesc" as their values,
but from the log, it shows this statement is generated by hibernate:
insert into groups (name, description, id) values (aname, adesc, 1)
And that causes GrammarException because aname and adesc is not quoted.
I ran the same in postgres manually and it won't run. The correct sql should be:
insert into groups (name, description, id) values ("aname","adesc", 1)
Then it runs successfully.
Why does the hibernate not surround string literal with quotes? is it a configuration somewhere I can set? I can't pass this point, please help me...
thanks. -lwen


Reply With Quote
