-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: can we define a pojo without a identity field
PostPosted: Fri Apr 03, 2009 6:02 am 
Newbie

Joined: Fri Apr 03, 2009 5:46 am
Posts: 1
I am fairly new to hibernate. Here I have a database table which includes zip code info and does not have an id column. (This is a third party database table which we used in our application). I am using xdoclet to generate mapping files. So I created POJO class which represents this table structure. Then I tried to compile this using xdoclet and I am getting following exception

[hibernatedoclet] xdoclet.XDocletException: Class com.abc.model.ZipInfo misses ID property

Can we define a class with out a id field? Can you please explain the reason for this?

Thanks
prasanna


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 8:31 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
Make a composite key and include every column as part of the composite key.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.