-->
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: Spikes, FOSS JPA 1.0 test harness
PostPosted: Sun May 11, 2008 6:01 pm 
Newbie

Joined: Sat May 10, 2008 11:52 am
Posts: 3
Location: Verona, Italy
Dear list,

I made the mistake of posting this to the Hibernate users list, before I noticed that this list existed. My apologies for the unintentional 'cross posting'.

I have prepared a (very) small open source project to provide domain entity mapping and association examples, together with a programmatic interface to reach outside the JPA 1.0 specifications. Currently it works with Hibernate, EclipseLink and (almost, but not quite) OpenJPA.
The intention is to provide a 'third' alternative to annotations and/or persistence.xml, where the entity classes contain only JPA annotations, with any remaining changes being made programmatically. The one-to-many example defines CascadeType.ALL, but actually requires a 'delete-orphans' extension for the tests to succeed.

I had better warn you all that I am a freelance consultant working in Italy and I use and will be using this work to sell both the advantages and disadvantages (but with solutions) of using JPA 1.0. to my clients.

Although the Hibernate part works, the programmatic interface is rather clumsy, having to practically recreate the HibernatePersistence class, yuk! Working in a vacuum (that's me and myself, and we don't always agree) does mean that I'm never quite sure that I've found a "good enough" solution. Any help would be greatly appreciated. I am working 'in collaboration with' two Java User Groups (Torino and Trento), but it's really me who wrote most of the code.

The open source project, called Spikes (guess why) can be downloaded via Subversion with the command:
Code:
svn checkout https://lab.jugtorino.it/svn/sandbox/spikes/trunk spikes

There is a Trac site at http://lab.jugtorino.it/trac/sandbox/wiki/Spikes, which I have converted to English in most places, and also an article (which started the project rolling) http://www.syger.it/Tutorials/JPA10Gotchas.html

Best regards
John Leach, Verona, Italy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 4:24 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I think a better way to do it is to hack around EJB3ReflectionManager
As a matter of fact, XML is building annotations before the processing.
This is not really open open, but if you have some ideas/prototype let me know.

But frankly, I think you're too picky about multiple annotations on a method.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 06, 2008 8:14 am 
Newbie

Joined: Sat May 10, 2008 11:52 am
Posts: 3
Location: Verona, Italy
Dear Emmanuel,

Thank you for your reply. I agree that wanting to avoid having multiple annotations may seem picky, but having external code specifically for a given JPA vendor helps calculate the cost of translation to another JPA vendor. Otherwise I'd just have to 'count' the vendor specific annotations. Which is pickier?
I have submitted a patch which will allow simple programmatic interfacing to Hibernate's JPA interface, see
http://opensource.atlassian.com/project ... se/EJB-360
perhaps you'd care to take a look, or give me a pointer to 'hacking' with the EJB3ReflectionManager?

Best regards,
John Leach


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 11, 2008 9:58 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
John Leach wrote:
Dear Emmanuel,

Thank you for your reply. I agree that wanting to avoid having multiple annotations may seem picky, but having external code specifically for a given JPA vendor helps calculate the cost of translation to another JPA vendor. Otherwise I'd just have to 'count' the vendor specific annotations. Which is pickier?


Even grep can do that in a subsecond :)


Quote:
I have submitted a patch which will allow simple programmatic interfacing to Hibernate's JPA interface, see
http://opensource.atlassian.com/project ... se/EJB-360
perhaps you'd care to take a look, or give me a pointer to 'hacking' with the EJB3ReflectionManager?


http://anonsvn.jboss.org/repos/hibernat ... nager.java
and
http://anonsvn.jboss.org/repos/hibernat ... eader.java

are the interesting classes to do an integration. The only pb is that this is not yet possible to customize the reflectionmanager used.

_________________
Emmanuel


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.