-->
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.  [ 3 posts ] 
Author Message
 Post subject: Why does the package attribute not seem to apply?
PostPosted: Thu Feb 26, 2004 3:14 pm 
Newbie

Joined: Thu Feb 26, 2004 3:02 pm
Posts: 1
I am using Hibernate 2.1.2. I have a seemingly simple mapping file (irrelevant bits omitted):

Code:
<hibernate-mapping package="my.root.package.hibernate">
  <class name="Person" table="person">
    <id name="key" type="integer" column="person_key">
      <generator class="native"/>
    </id>
    <property name="givenName" type="character" column="person_given_name"/>
    <property name="familyName" type="character" column="person_family_name"/>
  </class>
</hibernate-mapping>

I run the Hbm2JavaTask from my Ant build.xml and it runs to completion with no warnings or errors. However, the generated Java code has no package declaration and is located in my root source code directory (which is appropriate for no being in a package).

My understanding from reading the documentation was that the package attribute should apply to all unqualified class names in the mapping file, including the unqualified class name given in the class element. Thus, I expected the generated Java class file to contain

Code:
package my.root.package.hibernate;

Did I misunderstand the documentation? If so, to what exactly does the named package string apply?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 11:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I guess the behavior you expect is arguable, but put it to JIRA.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 12:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yeah, this is due to hbm2java not having been updated to current Hibernate core functionality. We will make sure that gets fixed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.