-->
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: POJO Class Visibility
PostPosted: Wed Aug 23, 2006 7:07 am 
Newbie

Joined: Tue Mar 21, 2006 9:25 am
Posts: 8
I would like to ensure that users of my persistence service are not aware of the POJO implementation classes. I have achieved this by defining my domain model as interfaces and declaring the POJO implementation classes to have default (package) level visibility. The persistence service implementation is in the same package so can access them. No other code can get visibility, e.g. it has to call onto factory classes to instantiate the POJO implementations.

Hibernate Core seems to be happy with this and I see nothing in the EJB3 specs that say you can't do this. It does however fail when using the Hibernate Validator as it's current implementation is not able to call onto the methods of the POJO class. I assume this would be easy to change (as the Hibernate Core obviously can do it), but I thought I'd pause and reflect before requesting such a change.

Does anyone have an opinion or any experience on this approach?
Am I likely to encounter more stumbling blocks?
Would I be better off making the POJOs public and relying on project dependencies to control visibility (although these are more easily circumvented)?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 12:57 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If you provide a patch and post it to JIRA to make it work, I'll have a look.

_________________
Emmanuel


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.