I'm studying hibernate for next project.
As I wrote a few test codes I faced some problem.
In my test project (named Blog)
there is an article and some comments
article has rows(id, writer, content)
and there are comments for some article
Comments -> (a_id, id, writer, comment)
a_id is a key which direct to article
id is and id value of Comments
I can write article and add comment
but I cannot delete any comment from an article.
when I try to delete a comment,
there's an SQL like
"UPDATE comment set a_id=null, id=null where a_id=x, id=y"
but the fields(a_id and id) cannot be null....
how can i correct this problem?
P.S : Is there any sample projects which are good to study hibernate?
|