-->
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.  [ 9 posts ] 
Author Message
 Post subject: hbm2java and hbm2dao capitilization error
PostPosted: Thu Jul 13, 2006 4:49 pm 
Newbie

Joined: Thu Jul 13, 2006 9:49 am
Posts: 8
I am using a Hibernate Mapping document and the Hibernate Tools Ant tasks to generate domain and DAO code. Here is my hbm.xml:

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="com.me.client.hibernate.AuditTypeLookup" table="AuditTypeLookup" schema="PUBLIC">
        <id name="type" type="int">
            <column name="Type" />
            <generator class="assigned" />
        </id>
        <property name="description" type="string">
            <column name="Description" length="127" />
        </property>
    </class>
</hibernate-mapping>


When I run hbm2java (to generate the domain code) and hbm2dao (to generate the DAO code) I get a file named "Activitytypelookup.java" which contains a class named "ActivityTypeLookup". You will notice that "Activitytypelookup" is not the same as "ActivityTypeLookup". Of course, this mismatch generates a compiler error. The file should be named "ActivityTypeLookup.java". What should I do?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 7:52 pm 
Newbie

Joined: Thu Jul 13, 2006 9:49 am
Posts: 8
Oh yeah, the file "Audittypelookup.java" is created by hbm2java, and another file ("AudittypelookupHome.java") is created by hbm2dao. As you can see, however, they both suffer from the same capitalization problem.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 1:17 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm....should not happen.

put it in jira with a small testcase so we dont forget it.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:31 am 
Newbie

Joined: Thu Jul 13, 2006 9:49 am
Posts: 8
Well, as I was writing up the test case for it I figured out what was happening. If you don't delete the previously generated files then the old filename remains intact even though the contents are updated. However, if you delete the previously generated files and generate them again then everything works correctly.

You still want me to write that up as a jira?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
is that a windows side effect ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:41 am 
Newbie

Joined: Thu Jul 13, 2006 9:49 am
Posts: 8
That would be my guess, but I have no way to tell since I don't have any desktop linux systems to test with.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:48 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok- but at some point (the first time) you created a file or named the class with the the lower 't', rihgt ? and then afterwards it just stuck around ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:49 am 
Newbie

Joined: Thu Jul 13, 2006 9:49 am
Posts: 8
Exactly.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 14, 2006 9:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok, so not much i can really do about it except slowing the whole generation down by first deleteing the file before writing it....not fun either ;)

_________________
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.  [ 9 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.