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.  [ 2 posts ] 
Author Message
 Post subject: Shouldn't Middlegen R3 put UNIQUE constraints?
PostPosted: Thu Feb 05, 2004 11:54 am 
Pro
Pro

Joined: Wed Oct 08, 2003 10:31 am
Posts: 247
Shouldn't Middlegen R3 put the unique="true" in the mapping files when needed?
Don't remember. Looking at my mappings, I don't see this constraint where it supposed to be.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2004 12:18 pm 
Regular
Regular

Joined: Fri Jan 16, 2004 4:48 am
Posts: 56
Continuing on this, I am just wondering on the best pracitices or the approach taken by others.

In my case, if I have a legacy database, I use middlegen to generate the mapping file (with xdoclet-hibernate tags turned on) and then create the java code. Once I have the java code, I edit the tags to add more information like "type" or "sql-type" since middlegen screws up with the NUMBER (n,n) format, "length". I can then add additional functions to my liking. This becomes my source code the , I use the top-down approach to recreate the mapping files any time attributes get chaged.

In case I don't have a legacy database, I follow the middle approach where in I create the mapping file with the hibernate tags and then generate the java code. Once I jave the java code, I then check the tags and then revert back to top-down approach.

I am just trying to look at the ways to reduce the time taken to setup a persistence layer and I find that at some point or other, I have to edit the java code to put in some custom function. Therefore I have to ultimately revert to top down approach.

Does anyome have a better approach and would be willing to share it here.

Thanks


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