-->
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.  [ 7 posts ] 
Author Message
 Post subject: MyGeneration, no template for relationships
PostPosted: Wed Aug 31, 2005 6:17 pm 
I've tried the 2 templates that Mygeneration has links to and both seem to lack the ability to define relationships between objects. i.e. The hbm.xml files don't have one to one/one to many relationships defined, and the same in classes.

As an example say you have an order and customer table. It will create the the two classes, but it wont put in Order.getCustomer() method in the class. I am fairly certain I am using the templates correctly, but without having these defined the templates and thus MyGeneration seem fairly useless.


Top
  
 
 Post subject:
PostPosted: Fri Sep 02, 2005 6:12 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
IIRC, some relationships were supported by MyGeneration templates...

Anyway, you can always add/customize them :wink:

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2005 11:01 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Sorry, I haven't had any time to worry about the MyGen templates. I've been using NHibernate Analyzer lately. MyGen is only helpful in legacy environments, and coding the templates is tedious.

It's not too hard to tweak the templates if you are so inclined.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 4:36 pm 
The lack of relationship support in the MyGeneration template for NHibernate is a big issue for us. Legacy environments are why many of us have jobs ... to clean up customer's existing crap that they won't let go of ...

Assuming there is such support in the Hibernate template, shouldn't it be easy to convert?


Top
  
 
 Post subject:
PostPosted: Sat Oct 15, 2005 3:42 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
If there is a Hibernate template in MyGeneration, it shouldn't be too hard to convert.

Another possible tool is the ActiveRecord Generator. It isn't great with relationships yet, but it is a nice shortcut. If you don't want to use ActiveRecord, though, I guss that doesn't help much.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 6:26 am 
Beginner
Beginner

Joined: Mon Oct 03, 2005 4:59 am
Posts: 26
Location: Cambridge, UK
I have hacked kdub's MyGeneration template to add support for one-to-many relationships, and do plan to publish those changes as soon as I can a) get some free time, and b) figure out how to do so on MyGeneration's template page. It's true that tweaking the templates isn't very hard.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 9:53 am 
Beginner
Beginner

Joined: Mon Oct 03, 2005 4:59 am
Posts: 26
Location: Cambridge, UK
Miraculously, some free time showed up in my day today, so with some help from MyGeneration's forums, I put up my modified version of k-dub's template. Among other changes, it includes support for one-to-many relations, null tests for the setter properties of not-null columns, and a required (not-null) fields constructor.


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