It's not a secret anymore!
The moose likes Object Relational Mapping and the fly likes How mapping -> Composite Id?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How mapping -> Composite Id??" Watch "How mapping -> Composite Id??" New topic

How mapping -> Composite Id??

Bruno Ambrozio

Joined: May 24, 2004
Posts: 2

I have this table and i need to map this. this fields will be composite keys and i would like that anyone help me to configure my hibernate mapping...

| Field | Type | Null | Key | Default | Extra |
| bairro | int(11) | | PRI | NULL | |
| logradouro | int(20) | | PRI | NULL | |

I have tried but, i didn�t get it.

I wait that anyone help me!!!

Thank u!

Bruno Brigantini Ambr�zio<br />SCJP 1.4<br />Brazil
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Mapping composite IDs can be a little fiddly Bruno Ambrozio. The example in the Hibernate documentation is as much direstion as anyone can really give you. If you are sure you've carefully tried this, why don't you post you mapping (and possibly the error Hibernate is returning) etc. and we'll see if anyone can spot what's wrong?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: How mapping -> Composite Id??
jQuery in Action, 3rd edition