-->
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: Annotations acceptable for reusable domain entities?
PostPosted: Sun Sep 14, 2008 2:27 am 
Regular
Regular

Joined: Sun Sep 25, 2005 11:35 pm
Posts: 57
Clearly, annotations simplify the maintenance of persistent domain entities. However, I have a situation where the same set of entities will be used in multiple applications - the main Java application that runs on a server, a swing client that needs to display and manipulate the entities, and finally some external applications that do what-if analysis on the same entities. Only the main Java application needs to persist them. If I use JPA annotations then I am forcing all applications to link with JPA and Hibernate for no good reason. What is the recommendation in this situation - use annotations or switch to xml configuration (the latter option allows linking to JPA/Hibernate only when needed)?

Thanks.
Naresh


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 16, 2008 9:02 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

personally I don't see a problem there. If you are sticking with JPA annotations all you need to include for your clients is the javax.persistence jar. You don't have to include the actual Hibernate runtime dependencies. I think that is a fair price for a more compact and easier to maintain meta data configuration.

Maybe this thread is also of interest for you: http://forum.hibernate.org/viewtopic.php?p=2391258.

However, the whole discussion is certainly a little bit of a religious one, similar to database design and many other design questions. I am sure there many developers out there who would consider using annotations in this case as 'not clean'.

I don't think there is a definite right or wrong answer to your questions. Sorry :)

--Hardy


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.