You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Piero Sartini <ps...@sartini-its.com> on 2009/08/26 14:47:56 UTC

Re: Noob: Wishing for a tapestry-jpa like tapestry-hibernate

>      Oh well, diving in to see how far I can get by just taking
> tapestry-hibernate and making a JPA version.

I did the same some time ago. It works for me, but is far from being complete:
http://bitbucket.org/psartini/tapestry-jpa/

There is a lot of stuff missing, especially the more advanced tapestry 
features - but the core functionalities are working. There are no tests 
available as well. But maybe it is a good starting point.

About your usecase.. it's not possible to use 2 different Persistence Units 
right now. It is configured throught the application defaults like this:

configuration.add(JPASymbols.PERSISTENCE_UNIT, "yourPU");


	Piero


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Noob: Wishing for a tapestry-jpa like tapestry-hibernate

Posted by "Pierce T. Wetter III" <pi...@paceap.com>.
>>>    Oh well, diving in to see how far I can get by just taking
>>> tapestry-hibernate and making a JPA version.
>>
>> I did the same some time ago. It works for me, but is far from  
>> being complete:
>> http://bitbucket.org/psartini/tapestry-jpa/
>>
>> There is a lot of stuff missing, especially the more advanced  
>> tapestry
>> features - but the core functionalities are working. There are no  
>> tests
>> available as well. But maybe it is a good starting point.
>>
>> About your usecase.. it's not possible to use 2 different  
>> Persistence Units
>> right now. It is configured throught the application defaults like  
>> this:
>>
>> configuration.add(JPASymbols.PERSISTENCE_UNIT, "yourPU");
>
>  Cool, thanks, I'll crib from this into my implementation.

   Ok, here's where I'm at:

       I took tapestry-hibernate and tapestry-jpa and migrated them  
all to JPA terminology. As part of that, I built the following classes:

   CompositeEntityManagerFactory
   CompositeEntityManager
   CompositeEntityTransaction

   What they do is take a list of persistence units and produce a  
meta- version of each that lets you treat the composite as a whole. So  
commit() commits them all, clear() clear's them all, etc.

   The idea would be that you could do:

    configuration.add(JPASymbols.PERSISTENCE_UNITS,  
{"yourFirstPU","yourSecondPU");

   I'm now a bit stuck though, because I decided it would be nice if  
you could do:

   @CommitAfter("yourFirstPU") to only commit in the first PU, while  
rolling back the second.

   But I can't quite figure out how to get the value from the  
annotation to CommitAfterWorker.

   There's also a lot of stuff I'm not quite following, so I'm not  
totally sure I've implemented it correctly.

   Is anyone who knows more about JPA/Tapestry willing to pick up from  
where I've left off? I should be closer.

   If so I can look into doing a similar thing for hibernate so that  
you can access multiple databases via Hibernate.

   Pierce

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Noob: Wishing for a tapestry-jpa like tapestry-hibernate

Posted by "Pierce T. Wetter III" <pi...@paceap.com>.
On Aug 26, 2009, at 5:47 AM, Piero Sartini wrote:

>>     Oh well, diving in to see how far I can get by just taking
>> tapestry-hibernate and making a JPA version.
>
> I did the same some time ago. It works for me, but is far from being  
> complete:
> http://bitbucket.org/psartini/tapestry-jpa/
>
> There is a lot of stuff missing, especially the more advanced tapestry
> features - but the core functionalities are working. There are no  
> tests
> available as well. But maybe it is a good starting point.
>
> About your usecase.. it's not possible to use 2 different  
> Persistence Units
> right now. It is configured throught the application defaults like  
> this:
>
> configuration.add(JPASymbols.PERSISTENCE_UNIT, "yourPU");

   Cool, thanks, I'll crib from this into my implementation.

  Pierce


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org