reset password
Author Message
Urvashi
Posts: 34
Posted 17:52 Apr 21, 2009 |

Hello Professor,

I am getting the following error when i am trying to build hbm2ddl.

Foreign key (FK554D05B3BE81C5EC:Blog_Comment_attachments [comment_id])) must have same number of columns as the referenced primary key (comments [Blog_entry_id,elt])

what is elt here? and how can this error be corrected?

Thank You.

cysun
Posts: 2935
Posted 20:08 Apr 21, 2009 |

It looks like your comments table has a composite primary key [Blog_entry_id,elt], which most likely is not right. You should have an id field being the primary key. There are plenty of model classes/mapping in CSNS. Read some of them and use them as examples.

Urvashi
Posts: 34
Posted 20:53 Apr 21, 2009 |
cysun wrote:

It looks like your comments table has a composite primary key [Blog_entry_id,elt], which most likely is not right. You should have an id field being the primary key. There are plenty of model classes/mapping in CSNS. Read some of them and use them as examples.

ok thank you..one more question. When i create an xml file for Blog, i am using one-to-one mapping, there, it throws an error when i try to fill out the column attribute.

and it doesn't show the column in the ddl ....is it ok or something wrong ?

cysun
Posts: 2935
Posted 21:57 Apr 21, 2009 |
Urvashi wrote:
cysun wrote:

It looks like your comments table has a composite primary key [Blog_entry_id,elt], which most likely is not right. You should have an id field being the primary key. There are plenty of model classes/mapping in CSNS. Read some of them and use them as examples.

ok thank you..one more question. When i create an xml file for Blog, i am using one-to-one mapping, there, it throws an error when i try to fill out the column attribute.

and it doesn't show the column in the ddl ....is it ok or something wrong ?

If it "throws an error", it's wrong.