-->
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: Help with Id
PostPosted: Tue Jan 12, 2010 12:40 pm 
Newbie

Joined: Thu Nov 26, 2009 1:55 pm
Posts: 3
Hi,

I'm trying to persist this class:
Code:
public class A{

    protected String XX;
    protected String YY;
}


If i use Hibernate tools to generate the hbm.xml file i won't get an "id". I know one must have an "id" in every table persisted, so, is there a way of persisting this class without changing it original form?

thanks!


Top
 Profile  
 
 Post subject: Re: Help with Id
PostPosted: Sun Jan 17, 2010 1:06 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
To use Hibernate, as you said, you need to identify a primary key.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.