-->
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: Practical tips
PostPosted: Wed Jan 04, 2006 5:56 am 
Newbie

Joined: Wed Jan 04, 2006 5:33 am
Posts: 2
Hi all,

I'm looking for some practical tips using Hibernate and keeping model, config files and sql in sync. Apologies if this has been posed earlier, if so just point me to the message/site.

I'm looking at using the latest release of Hibernate but the question concerns more general practical use.

From what I see there are several ways to generate code/files etc using Xdoclet, Annotaions and xml mapping files. Each probably have their own advantages/disadvantages depending on the situation. But what choices do most people make with a new project? What is leading.

1. In one project the developers were using the xml files as leading. From there both the model and SQL were being generated.

2. In another project I saw developers using XDoclet tags in the code afterwhich one can generate SQL and XML files.

Now I see that it's possible to use Hibernate Annotations but one requires JDK 1.5

My preference would be to model the code add Annotations and from there generate SQL and config files. I don't favour the xml oriented manner but perhaps others do have good experience with this?

Curious to see reactions as *preffered manner of use* pitfalls of one against the other

Colin


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 6:32 am 
Regular
Regular

Joined: Tue Jan 03, 2006 9:20 am
Posts: 74
Whichever you choose, stick to it.
Choosing one method and sticking to it is more important than which method you actually choose.

Personally I don't like the idea of mixing metadata with code so annotation and doclet tags aren't my thing.
In fact I'd sooner ban them from being used at all than even consider using them.

On many realworld projects you'll likely find an existing database, so the DDL would be leading.
If you're in an ideal situation where you can determine the database model as well as the code model the application logic would likely be the most obvious thing to have leading as it more clearly indicates that the data is there to support the application rather than driving the application.


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.