-->
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.  [ 12 posts ] 
Author Message
 Post subject: hbm2java not generating java classes for composite elements
PostPosted: Thu Aug 11, 2005 10:58 am 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
I have a joined-subclass that has a list of composite-element. I ran hbm2java on top this and I noticed that the composite-element classes were not being generated. Is this a known issue?
Thanks
Sreeram


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 1:57 am 
Regular
Regular

Joined: Tue Nov 09, 2004 5:15 pm
Posts: 100
Are you using .hbm mapping files or annotations?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 3:09 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
.hbm


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 9:49 pm 
Beginner
Beginner

Joined: Thu Mar 31, 2005 9:58 pm
Posts: 25
Location: Valparaiso
What database are you using?

post your mapping files!

_________________
Daniel Casanueva R.

Jcode
Valparaiso, Chile


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 12:58 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
sybase. But I guess it shouldn't matter. I was trying to generate java classes from .hbm mapping file. One of the element is a composite-element and the equivalent class is not getting generated.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 1:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what version ? H3 tools ?

should work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 3:44 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
Yes I am using 3.0 tools. I tried in two scenarios and it didn't generate in both cases. It does add the getter and setter methods for the set/list in the container class but is not generating the classes for the composite element.
A related question, how can i use criteria to query on the composite-elements?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 4:23 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
lets keep things separate here ;)

please provide a failing test caes for the hbm2java issue and put it in jira

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:16 pm 
Beginner
Beginner

Joined: Wed Jul 06, 2005 4:51 pm
Posts: 27
Here is the test case you asked for. It generates class for Test but not for TestComposite

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="com.test.what">
<class
name="Test"
table="Test"
>
<id
name="Id"
type="integer"
column="testId"
>
<generator class="hilo">
<param name="table">testIdTracker</param>
<param name="column">testId</param>
</generator>
</id>
<property
name="TestTypeId"
column="testTypeId"
type="integer"
not-null="true"
length="10"
/>
<set name="TestComposites" table="TestComposite" cascade="all" lazy="false">
<key column="testId" />
<composite-element class="TestComposite">
<property
name="CompositeId"
column="compositeId"
type="integer"
not-null="true"
length="10"
/>
</composite-element>
</set>
</class>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 18, 2005 5:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
im quite sure this is fixed in the latest cvs

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 20, 2005 10:54 pm 
Newbie

Joined: Fri Aug 19, 2005 2:55 am
Posts: 1
How about for annotation? I am using annotation and composite id case is failed.

I can't get generated sources to be compile.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 21, 2005 5:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I cant help much without any info....like example, what compile error...etc

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