-->
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.  [ 4 posts ] 
Author Message
 Post subject: mappingResources vs annotatedClasses
PostPosted: Mon Feb 04, 2013 4:53 pm 
Newbie

Joined: Mon Feb 04, 2013 2:28 pm
Posts: 4
Whats the pros and cons of using mappingResources vs annotatedClasses with Spring and Hibernate?

I am working on a Spring MVC project and I always used annotatedClasses... Java Classes that had the @Table, @Column etc tags within the code. I just seen a sample does use hbm.xml files to do the mapping. Which way is bettering?


Top
 Profile  
 
 Post subject: Re: mappingResources vs annotatedClasses
PostPosted: Wed Feb 06, 2013 6:26 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
Lets take it one by one.
First annotation classes :
1) It is simple and easy to maintain and learn also
2) If you have to shift to a new database then not much changes are needed.
3) If you changes some bean name in the class, less changes.
4) It also give you a view of EJB.

Second mapping XML :
1) you can gave all the mapping in one place.
2) Easier to maintain as a whole.
3) error at one place may lead to some error at another place.So some times really messy to get the error.

Third option is you can also use a mixture of both of them

Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


Top
 Profile  
 
 Post subject: Re: mappingResources vs annotatedClasses
PostPosted: Wed Feb 06, 2013 9:09 am 
Newbie

Joined: Mon Feb 04, 2013 2:28 pm
Posts: 4
Thanks. anyway to make "Hibernate reverse engineering" to make the code annotatedClasses style and not mappingResources style?


Top
 Profile  
 
 Post subject: Re: mappingResources vs annotatedClasses
PostPosted: Wed Feb 06, 2013 9:44 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
Sorry. Didn't get you. Can you explain briefly ?

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


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