-->
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: Simple question on the id in the hbm.xml file
PostPosted: Wed Oct 19, 2005 5:43 pm 
Newbie

Joined: Wed Oct 19, 2005 3:01 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

I've scoured through Hibernate in Action, and Hibernate Quickly and through this forum trying to find an answer to this question. I have a table that has not primary key or unique key. When I generate a hbm.xml file for this table from eclipse. There is an error because there is no identifer in that table stating a primary key. Although I can add one such as a numeric value to each row, I wanted to know if it is possible to put in a dummy id tag with a dummy column?


Hibernate version: 3

Mapping documents:

Here is the hbm.xml file:
<class name="RefAddressValidation" table="REF_ADDRESS_VALIDATION">

<property name="postcode" column="POSTCODE" type="string"
not-null="true" />
<property name="stateprovcode" column="STATEPROVCODE"
type="string" />
<property name="city" column="CITY" type="string"
not-null="true" />
<property name="county" column="COUNTY" type="string" />
<property name="preference" column="PREFERENCE" type="string" />
<property name="validity" column="VALIDITY" type="string" />
<property name="countryid" column="COUNTRYID" type="string" />
<property name="stateprovname" column="STATEPROVNAME"
type="string" />
<property name="shiptoflag" column="SHIPTOFLAG" type="byte" />
</class>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 19, 2005 7:12 pm 
Beginner
Beginner

Joined: Tue Nov 25, 2003 3:33 pm
Posts: 35
nope, check out the DTD you will see that ID must be there


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.