-->
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: hbm2java (3.00alpha1) not generating id-property-code
PostPosted: Wed Mar 02, 2005 3:58 am 
Newbie

Joined: Tue Mar 01, 2005 2:37 pm
Posts: 1
I'm fairly new to hibernate and use hibernate-tools-3.0alpha1 together with Hibernate 3.0 rc1.
Whenever I try to generate java code from any mapping document the generated code doesn't contain any reference to the id-property that Hibernate seems to need. (When I simply try to run an example it fails, because there are no id-accessor-methods).

After adding
Code:
private Integer id;
private Integer getId() ...
private void setId(Integer id) ...
to the generated POJO the example runs flawless.

For example a mapping-file of mine looks like:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0/EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
  <class name="Test" table="test">
    <id name="id" type="int" column="ID">
      <generator class="native"/>
    </id>
    <property name="test" type="string" />
  </class>
</hibernate-mapping>


As far as I understand hbm2java should generate code for the id-property, but I didn't find any report in JIRA, so I suppose I'm doing something the wrong way.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
or you might have found a bug ,)

even though very much unlikely since its a basic thing that the unittests even test.

but if your sure the mappinngs contain the id then post a failing example to the jira.

_________________
Max
Don't forget to rate


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.