You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Igor Drobiazko <ig...@gmail.com> on 2011/02/11 10:05:00 UTC

JPA/HIbernate/ORM

Hi all,

since our last 5.3/5.4 discussion I've been thinking about JPA integration
and came to the conclusion that Tapestry must have a built-in support for
JPA. Even though I personally still prefer Hibernate, I'm pretty sure JPA is
the future and we need to support it out of the box.

In the next days I'll add tapestry-jpa module to our SVN. How will this
module differ from Tynamo's module? Well, first of all the Tynamo's
implementation is a copy of tapestry-hibernate module. Implementing support
in Tapestry allows us to reuse code by providing a new module tapestry-orm.

So, the plan is:

- add tapestry-orm module which will contain the functionality from
tapestry-hibernate-core. This module will be use by both tapestry-hibernat
and tapestry-jpa. For backward compatibility reasons we can't just rename
the packages org.apache.tapestry5.hibernate to org.apache.tapestry5.orm, but
need to copy the classes.
- Deprecating tapestry-hibernate-core in 5.3, removing it in 5.4.
- Refactoring tapestry-hibernate to use tapestry-orm

-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: JPA/HIbernate/ORM

Posted by antalk <an...@intercommit.nl>.
Excellent ! I'm all in for it. This is number one on my want-to-have list. 

There is already an issue : TAP5-48 about this, i think you already know
this ? And another one TAP5-57. Both are high on the popular issue list so i
think lots of people would be interested in the solution.

Thanks.
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/JPA-HIbernate-ORM-tp3380824p3380843.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: JPA/HIbernate/ORM

Posted by Alex Kotchnev <ak...@gmail.com>.
On tapestry-jdo : I already have a first pass at the implementation(that is,
I converted the tynamo-jpa and tynamo-jpa-core to tynamo-jdo and
tynamo-jdo-core to use the JDO APIs), but still need to test it out and make
sure that everything works as expected. The only thing that didn't transfer
over well was the query data grid (or whatever it was called) implementation
as JDO doesn't have a type safe criteria API like hibernate or JPA.

I'm not very sure how a common ORM module would work across JPA, Hibernate,
and JDO - currently, the mentioned "core" module does deal w/ the API
specific classes (e.g. Hibernate with Session, JDO w/ PersistenceManager).
Maybe something that straddles Hibernate and JPA would be more feasible as
they're much more alike...

Cheers,

Alex K

On Fri, Feb 11, 2011 at 10:02 AM, Kalle Korhonen <kalle.o.korhonen@gmail.com
> wrote:

> On Fri, Feb 11, 2011 at 2:24 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
> > On Fri, 11 Feb 2011 07:05:00 -0200, Igor Drobiazko
> > <ig...@gmail.com> wrote:
> >> since our last 5.3/5.4 discussion I've been thinking about JPA
> integration
> >> and came to the conclusion that Tapestry must have a built-in support
> for
> >> JPA. Even though I personally still prefer Hibernate, I'm pretty sure
> JPA
> >> is the future and we need to support it out of the box.
> > JPA 2 has most (if not all) the features Hibernate has that JPA 1 didn't.
> I
> > haven't used JPA yet, but I agree that it's the future.
>
> Currently, Tynamo offers modules both for JPA1 and JPA2. Igor would
> need to work carefully to move the common logic to the orm module, but
> certainly it'd be better for code reusability. What would make this
> package orm specific? Not absolutely sure it needs to be, I know that
> Alex Kotchnev is at least thinking about making a tapestry-jdo module.
>
> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: JPA/HIbernate/ORM

Posted by Kalle Korhonen <ka...@gmail.com>.
On Tue, Feb 15, 2011 at 1:07 AM, Igor Drobiazko
<ig...@gmail.com> wrote:
> @Kalle: looks like Tynamo JPA integration only support a single persistence
> unit per application? RIght? Am I missing something?

At the moment, yes.

Kalle


> On Fri, Feb 11, 2011 at 4:02 PM, Kalle Korhonen
> <ka...@gmail.com>wrote:
>
>> On Fri, Feb 11, 2011 at 2:24 AM, Thiago H. de Paula Figueiredo
>> <th...@gmail.com> wrote:
>> > On Fri, 11 Feb 2011 07:05:00 -0200, Igor Drobiazko
>> > <ig...@gmail.com> wrote:
>> >> since our last 5.3/5.4 discussion I've been thinking about JPA
>> integration
>> >> and came to the conclusion that Tapestry must have a built-in support
>> for
>> >> JPA. Even though I personally still prefer Hibernate, I'm pretty sure
>> JPA
>> >> is the future and we need to support it out of the box.
>> > JPA 2 has most (if not all) the features Hibernate has that JPA 1 didn't.
>> I
>> > haven't used JPA yet, but I agree that it's the future.
>>
>> Currently, Tynamo offers modules both for JPA1 and JPA2. Igor would
>> need to work carefully to move the common logic to the orm module, but
>> certainly it'd be better for code reusability. What would make this
>> package orm specific? Not absolutely sure it needs to be, I know that
>> Alex Kotchnev is at least thinking about making a tapestry-jdo module.
>>
>> Kalle
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>

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


Re: JPA/HIbernate/ORM

Posted by Igor Drobiazko <ig...@gmail.com>.
@Kalle: looks like Tynamo JPA integration only support a single persistence
unit per application? RIght? Am I missing something?

On Fri, Feb 11, 2011 at 4:02 PM, Kalle Korhonen
<ka...@gmail.com>wrote:

> On Fri, Feb 11, 2011 at 2:24 AM, Thiago H. de Paula Figueiredo
> <th...@gmail.com> wrote:
> > On Fri, 11 Feb 2011 07:05:00 -0200, Igor Drobiazko
> > <ig...@gmail.com> wrote:
> >> since our last 5.3/5.4 discussion I've been thinking about JPA
> integration
> >> and came to the conclusion that Tapestry must have a built-in support
> for
> >> JPA. Even though I personally still prefer Hibernate, I'm pretty sure
> JPA
> >> is the future and we need to support it out of the box.
> > JPA 2 has most (if not all) the features Hibernate has that JPA 1 didn't.
> I
> > haven't used JPA yet, but I agree that it's the future.
>
> Currently, Tynamo offers modules both for JPA1 and JPA2. Igor would
> need to work carefully to move the common logic to the orm module, but
> certainly it'd be better for code reusability. What would make this
> package orm specific? Not absolutely sure it needs to be, I know that
> Alex Kotchnev is at least thinking about making a tapestry-jdo module.
>
> Kalle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: JPA/HIbernate/ORM

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Feb 11, 2011 at 2:24 AM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Fri, 11 Feb 2011 07:05:00 -0200, Igor Drobiazko
> <ig...@gmail.com> wrote:
>> since our last 5.3/5.4 discussion I've been thinking about JPA integration
>> and came to the conclusion that Tapestry must have a built-in support for
>> JPA. Even though I personally still prefer Hibernate, I'm pretty sure JPA
>> is the future and we need to support it out of the box.
> JPA 2 has most (if not all) the features Hibernate has that JPA 1 didn't. I
> haven't used JPA yet, but I agree that it's the future.

Currently, Tynamo offers modules both for JPA1 and JPA2. Igor would
need to work carefully to move the common logic to the orm module, but
certainly it'd be better for code reusability. What would make this
package orm specific? Not absolutely sure it needs to be, I know that
Alex Kotchnev is at least thinking about making a tapestry-jdo module.

Kalle

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


Re: JPA/HIbernate/ORM

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 11 Feb 2011 07:05:00 -0200, Igor Drobiazko  
<ig...@gmail.com> wrote:

> Hi all,

Hi, guys!

> since our last 5.3/5.4 discussion I've been thinking about JPA  
> integration and came to the conclusion that Tapestry must have a  
> built-in support for
> JPA. Even though I personally still prefer Hibernate, I'm pretty sure  
> JPA is the future and we need to support it out of the box.

JPA 2 has most (if not all) the features Hibernate has that JPA 1 didn't.  
I haven't used JPA yet, but I agree that it's the future.

> In the next days I'll add tapestry-jpa module to our SVN. How will this
> module differ from Tynamo's module? Well, first of all the Tynamo's
> implementation is a copy of tapestry-hibernate module. Implementing  
> support in Tapestry allows us to reuse code by providing a new module  
> tapestry-orm.

In addition to that, why don't we create a simple (at least in the  
beggining) transaction management package which uses the EJB 3 annotations  
and make tapestry-hibernate and tapestry-jpa to use it instead of their  
@CommitAfter annotations? This would cover a good part of what is common  
for Hibernate and JPA support: transaction management. At first, we could  
only support the REQUIRED transaction option (which is the one  
@CommitAfter implements) and later we can add more option implementations.

What do you think of it? I just haven't started it myself due to severe  
lack of free time. :(

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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