-->
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.  [ 6 posts ] 
Author Message
 Post subject: New Tutorial - Hibernate/Middlegen - Inheritance & M2M a
PostPosted: Sun May 16, 2004 12:16 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 9:36 am
Posts: 28
I've just uploaded part 2 of my hibernate tutorial series. This installment is an extension of part one based on some requests I've recieved from part 1. Specifically, this tutorial focuses on modifying file generated by the Hibernate/Middlegen plugin to handle inheritance and many-to-many associations correctly. As always I'd love to recieve some feedback.

Cheers,
Tyler Pitchford


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 12:17 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 9:36 am
Posts: 28
Whoops, I forgot the link.

http://www.warfrog.com/hibernatetutorial2/

Cheers,
Tyler


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 7:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Great to have more tutorials but I have recieved any requests for enhancements or bugs (and patches) for issues in the Many-to-many hbm generation. It is being actively worked on and the feedback helps me (and the Middlegen/Hibernate community).

Please use JIRA and Send to david@hibernate.org.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 8:20 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I have now read the tutorial. I do like the approach and information in general. I would like you to consider trying a few things and then update the tutorial as approrpriate.

1) I have also changed the class name algorithm recently which is in CVS. This improves the defaults. Its still not perfect but it can be further improved. In addition, tables names, Singular and Plural, can be set using the table tag. I would suggest trying it out see if this approach to table naming can be improved. Eg,

Code:
      <middlegen
           [cut attributes]
      >
           .....
           <table name="EMPLOYEES" singular="employee" plural="employees" />
     </middlegen>


2) Many-to-many (and in this case) the better option is to use Middlegen's ability to create (and display in the GUI) Many-to-many relationships directly. You set this up in the Ant script similar to above.

Code:

      <middlegen
           [cut attributes]
      >
           .....
           <many2many>
               <tablea generate="true" name="EMPLOYEES" />
               <jointable name="EMPLOYEES_DEPARTMENTS" generate="false" />
               <tableb generate="true" name="DEPARTMENTS" />
           </many2many>
     </middlegen>



You can combine these methods to get the result you were trying to illustrate.

Thanks for your efforts, I have started a detailed tutorial but getting the time to finsihed has been a challenge. Glad you have (started) the process. Hope this information helps you and others that are reading this post (and your tutorial [possibly updated]).

-- David.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 16, 2004 11:05 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 9:36 am
Posts: 28
David,

Thank you for the feedback, I'll add it to my tutorial. I'll do my best to update it tomorrow, but it's likely to take a week or so. I knew you could specify certain information using the ant task, but I didn't know the format so that's a great help I'll probably include both the information on how to modify it by hand and how to use the ant task commands if you don't mind.

Cheers,
Tyler


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 17, 2004 3:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
No problem with having both. I look forward to reading the update.


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