You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "matias.blasi" <ma...@gmail.com> on 2010/01/11 15:11:07 UTC

Is tapestry coupled with Hibernate API?

Hi, I am Matías.

As far I see, the tapestry persistant & transactional stuff is coupled with
Hibernate, don't you?

I would like to know if there is any contribution to override in order to
have a different Transaction Manager to use, or even more, another
SessionManager....

I know that if I inject an org.hibernate.Session in my service I am wiring
me with hibernate, but would like to have some middle-layer to be able to
configure another session manager.

Another point is the @CommitAfter annotation, if I'am not using Hibernate,
it has no sense... The CommitAfterWorker is wired to it.

Thank you in advance.
Matías.
-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27111015.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by Olle Hallin <ol...@hit.se>.
Or have a look at JDO, the very much under-appreciated predecessor to JPA.

I guess it would be very simple to implement @CommitAfter using the JDO api.

DataNucleus provides a JDO implementation (under the Apache 2 license),
which can use pretty much anything for the actual persistence (including
Excel, RDBMS:es, db4o, Amazon S3 and Google Big Table).

This way, you avoid vendor lock-in. See
http://www.datanucleus.org/products/index.html

Olle Hallin
Senior Java Developer and Architect
olle.hallin@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/11 Piero Sartini <li...@pierosartini.de>

> > So, do you think that the most flexible approach should be to have some
> > module like tapestry-jpa to interact with into the pages, and, the real
> > "data access layer" implementation could be inter-changable between
> > hibernate, db4o, and anyone which implements the JPA specification?
>
> If you use JPA, you may switch between the implementations:
> EclipseLink / Toplink, Hibernate, OpenJPA and DataNucleus to name a
> few.
> In practice I have never seen a project changing its underlying
> database.. but well, you may do this with JPA as well.
>
> For db4o, as it is no relational database I don't think it provides a
> JPA implementation. And if it does, I would not use it - you loose the
> power of object oriented databases by doing so. I've used NeoDatis
> (another OODB) myself and wrote a small plugin equal to tapestry-jpa
> to make its usage more pleasant (injecting ODB service and working
> @CommitAfter). You could take the same approach for db4o.
>
>         Piero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
> I would need some mechanism, which knows about the current data layer
> implementation I want to use (i.e. hibernate or any ohter else), then my DAO
> impl will not need to be re-written for multiples technologies.
> Anyway, that mechanism should know about the "supported" technologies and
> how to build their services (like the hibernate session)... I am not pretty
> sure, but I think this like the dom parser api (?) I remember it has a
> runtime mechanism to identify the implementation to be used, am I right?

For me, this sounds like what Hibernate, or JPA is all about -
abstract the database away from your business logic.
Now you want to abstract the database abstraction away... this does
not sound like a good idea.

      Piero

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


Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
> Differently from JPA, it also allows one to use OODBMSs, Excel, Google
> BigTable, Amazon EC2 and so on in addition to relational databases.
>
> By selecting JPA you cut of the possibility to use e.g., db4o as persistence
> engine.

I agree that JDO is a great technology. But I don't think it is useful
to switch between RDBMSs, OODBs, GraphDBs, BigTable or other
persistence strategies. If you try to abstract them away, you loose a
lot of their power.

Take the easy to use, type safe native queries of most OODBMs for an
example. Using them through JDO would force you to use JDOQL...

Also, for each of the named persistence solutions you need to know how
they work to write performant code. Take BigTable for example, without
thinking about a good schema and keys, you end up with very bad
performance. Its not possible to just throw your objects into such a
store. Looking at JPA projects, entites are often modeled with
database in mind - tis may be good or bad, but its often neccessary to
get good performance.

Of cource, JPA does not solve any of these problems - it just solves
your relational needs. But it does it well, and my argument is that
you would end up to rewrite your repositories if you try to switch
from an RDBMs to BigTable for example.

> (IMO there are far too many systems out there that routinely use a RDBMS as
> persistence engine. In many cases an OODBMS would have done the job with
> significantly less development effort.)

I agree, but I am not sure if we need all this abstraction. One of the
main advantage of an OODB is easier development - why should we
complicate things with JDO, and end up with more complexity than we
have with JPA? ;-)

          Piero

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


Re: Is tapestry coupled with Hibernate API?

Posted by Olle Hallin <ol...@hit.se>.
Once again, I recommend that you have a look at JDO.

Just like JPA, it is a standardized specification with several providers.

Differently from JPA, it also allows one to use OODBMSs, Excel, Google
BigTable, Amazon EC2 and so on in addition to relational databases.

By selecting JPA you cut of the possibility to use e.g., db4o as persistence
engine.

(IMO there are far too many systems out there that routinely use a RDBMS as
persistence engine. In many cases an OODBMS would have done the job with
significantly less development effort.)

Olle Hallin
Senior Java Developer and Architect
olle.hallin@crisp.se
www.crisp.se
http://www.linkedin.com/in/ollehallin



2010/1/12 Piero Sartini <li...@pierosartini.de>

> > As far as I understand, javax.persistence.EntityManager is an interface,
> so,
> > there should be any mechanism to determine which impl will be used at
> > runtime, right?
>
> Right. This is part of the JPA specification. You define the
> implementation inside your persistence.xml:
> ...
> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
> ...
>
>        Piero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
> As far as I understand, javax.persistence.EntityManager is an interface, so,
> there should be any mechanism to determine which impl will be used at
> runtime, right?

Right. This is part of the JPA specification. You define the
implementation inside your persistence.xml:
...
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
...

        Piero

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
Exactly that! I am seeing the code of
src/test/java/com/kenai/tapestryjpa/example/app0/services/UserDAOImpl.java

Here you inject:

package com.kenai.tapestryjpa.example.app0.services;

import javax.persistence.EntityManager;

public class UserDAOImpl implements UserDAO {                                          
        private final EntityManager entityManager;
        public UserDAOImpl(EntityManager value) {
                this.entityManager = value;
        }
        public void add(User user) {
                entityManager.persist(user);
        }

As far as I understand, javax.persistence.EntityManager is an interface, so,
there should be any mechanism to determine which impl will be used at
runtime, right?

Regards,
Matías.


Piero Sartini-3 wrote:
> 
>> My only question now, is "what about tapestry-jpa?" isn't it an
>> abstraction
>> for my scenario?
>> It hasn't documentation yet, but Piero, correct me if I am wrong, if I
>> use
>> the tapestry-jpa interfaces into my DAO implementation, I would be
>> de-coupled from the JPA implementation that I will be using at runtime,
>> right?
>>
>> Anyway, I don't know how I could inject a org.hibernate.EntityManager in
>> the
>> javax.persistence.EntityManager, since they don't share any interface.
> 
> You don't need the hibernate EntityManager... just inject the JPA
> EntityManager.
> I've created a demo webapp using JPA2 yesterday. You can find it
> inside the subversion repository:
> https://svn.kenai.com/svn/tapestry-jpa~main
> 
> Also I've wrote some quick notes on how to get started with tapestry-jpa:
> http://kenai.com/projects/tapestry-jpa/pages/Quickstart
> 
> They are work in progress, but maybe its still helpful.
> 
> To make everything easier, there is now also a maven2 repository for
> tapestry-jpa:
> http://tapestry-jpa.kenai.com/maven-snapshot-repository/
> 
> Hope this helps.
> 
>         Piero
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27127798.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
> My only question now, is "what about tapestry-jpa?" isn't it an abstraction
> for my scenario?
> It hasn't documentation yet, but Piero, correct me if I am wrong, if I use
> the tapestry-jpa interfaces into my DAO implementation, I would be
> de-coupled from the JPA implementation that I will be using at runtime,
> right?
>
> Anyway, I don't know how I could inject a org.hibernate.EntityManager in the
> javax.persistence.EntityManager, since they don't share any interface.

You don't need the hibernate EntityManager... just inject the JPA EntityManager.
I've created a demo webapp using JPA2 yesterday. You can find it
inside the subversion repository:
https://svn.kenai.com/svn/tapestry-jpa~main

Also I've wrote some quick notes on how to get started with tapestry-jpa:
http://kenai.com/projects/tapestry-jpa/pages/Quickstart

They are work in progress, but maybe its still helpful.

To make everything easier, there is now also a maven2 repository for
tapestry-jpa:
http://tapestry-jpa.kenai.com/maven-snapshot-repository/

Hope this helps.

        Piero

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


Re: Is tapestry coupled with Hibernate API?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 12 Jan 2010 11:32:31 -0200, matias.blasi <ma...@gmail.com>  
wrote:

> You catched me perfectly.
> I'm just researching if something like I described here exists.
> I'm doubting about being exagerating, perhaps this is the problem. :)

:)

> My only question now, is "what about tapestry-jpa?" isn't it an  
> abstraction for my scenario?

JPA is specification that defines how many things must be implemented.  
Changing implementations shouldn't make any difference to your code that  
uses JPA.
I don't consider it as an abstraction in this case because your DAO code  
that uses JPA doesn't change when the JPA implementation is changed. So  
what you need, if I'm got it right now, is already done by JPA being an  
specification.
Even when changing JPA implementatinos, I don't think you're changing  
technologies, as your code doesn't need to be changed.

> It hasn't documentation yet, but Piero, correct me if I am wrong, if I  
> use the tapestry-jpa interfaces into my DAO implementation, I would be
> de-coupled from the JPA implementation that I will be using at runtime,
> right?

I was talking about JPA vs Hibernate vs Bigtable vs DB4O vs JDO vs. etc.

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

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
You catched me perfectly.

I'm just researching if something like I described here exists.
I'm doubting about being exagerating, perhaps this is the problem. :)

My only question now, is "what about tapestry-jpa?" isn't it an abstraction
for my scenario?
It hasn't documentation yet, but Piero, correct me if I am wrong, if I use
the tapestry-jpa interfaces into my DAO implementation, I would be
de-coupled from the JPA implementation that I will be using at runtime,
right?

Anyway, I don't know how I could inject a org.hibernate.EntityManager in the
javax.persistence.EntityManager, since they don't share any interface.

Am I crazy? or it is something interesting? :)

Regards,
Matías.


Thiago H. de Paula Figueiredo wrote:
> 
> On Tue, 12 Jan 2010 11:11:12 -0200, matias.blasi <ma...@gmail.com>  
> wrote:
> 
>> public class UserDAOImpl {
>>
>>     @Inject
>>     private some.standard.persistence.api.Session sessionManager;
>>
>>     @some.new.annotation.not.coupled.with.any.technology.CommitAfter  //  
>> <-
>> I knwo, it should be in the interface
>>     @Override
>>     public void createUser(User user) {
>>         this.sessionManager.persist(user);     // I want this code to  
>> work
>> with any persistence technology, I know that it is a very small
>> 'reutilization' but, I am thinking in all my business modules, present in
>> many applications.
>>     }
>> }
> 
> I'm sorry, but it still doesn't make sense to me. A DAO is a way to  
> decouple the rest of the application of the details of the persistence,  
> but you're trying to decoulbe the DAO from the details of the persistence.  
> This looks like overengineering to me.
> 
>> I would need some mechanism, which knows about the current data layer
>> implementation I want to use (i.e. hibernate or any ohter else),
> 
> That's exactly the description of what a DAO does. What you want is a DAO  
> for your DAOs. I'm concerned with reuse and flexibility as much as you,  
> but I think you're exagerating here.
> 
>> then my DAO impl will not need to be re-written for multiples  
>> technologies.
> 
> You want an abstraction layer over and around persistence frameworks. I  
> don't know of any.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da  
> Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27127590.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 12 Jan 2010 11:11:12 -0200, matias.blasi <ma...@gmail.com>  
wrote:

> public class UserDAOImpl {
>
>     @Inject
>     private some.standard.persistence.api.Session sessionManager;
>
>     @some.new.annotation.not.coupled.with.any.technology.CommitAfter  //  
> <-
> I knwo, it should be in the interface
>     @Override
>     public void createUser(User user) {
>         this.sessionManager.persist(user);     // I want this code to  
> work
> with any persistence technology, I know that it is a very small
> 'reutilization' but, I am thinking in all my business modules, present in
> many applications.
>     }
> }

I'm sorry, but it still doesn't make sense to me. A DAO is a way to  
decouple the rest of the application of the details of the persistence,  
but you're trying to decoulbe the DAO from the details of the persistence.  
This looks like overengineering to me.

> I would need some mechanism, which knows about the current data layer
> implementation I want to use (i.e. hibernate or any ohter else),

That's exactly the description of what a DAO does. What you want is a DAO  
for your DAOs. I'm concerned with reuse and flexibility as much as you,  
but I think you're exagerating here.

> then my DAO impl will not need to be re-written for multiples  
> technologies.

You want an abstraction layer over and around persistence frameworks. I  
don't know of any.

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

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
Thank you again Thiago,

It would have sense in the following scenario:

public class UserDAOImpl {

    @Inject
    private some.standard.persistence.api.Session sessionManager;

    @some.new.annotation.not.coupled.with.any.technology.CommitAfter  // <-
I knwo, it should be in the interface
    @Override
    public void createUser(User user) {
        this.sessionManager.persist(user);     // I want this code to work
with any persistence technology, I know that it is a very small
'reutilization' but, I am thinking in all my business modules, present in
many applications.
    }
}

I would need some mechanism, which knows about the current data layer
implementation I want to use (i.e. hibernate or any ohter else), then my DAO
impl will not need to be re-written for multiples technologies.
Anyway, that mechanism should know about the "supported" technologies and
how to build their services (like the hibernate session)... I am not pretty
sure, but I think this like the dom parser api (?) I remember it has a
runtime mechanism to identify the implementation to be used, am I right?



Thiago H. de Paula Figueiredo wrote:
> 
> On Tue, 12 Jan 2010 10:33:33 -0200, matias.blasi <ma...@gmail.com>  
> wrote:
> 
>> Thank you Thiago,
> 
> :)
> 
>> I use that too, but I am trying to de-couple the DAO implementation from  
>> the underlaying database access. Then I would be able to re-use my  
>> module (with its DAOs) with any other data access technology.
> 
> The DAO implementation is the exactly the one which is tied to a given  
> data access technology (so everything else is independent), so you're  
> trying to create a two-layer persistence layer. ;) I'm sorry, but it  
> doesn't make sense to me.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da  
> Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27127315.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 12 Jan 2010 10:33:33 -0200, matias.blasi <ma...@gmail.com>  
wrote:

> Thank you Thiago,

:)

> I use that too, but I am trying to de-couple the DAO implementation from  
> the underlaying database access. Then I would be able to re-use my  
> module (with its DAOs) with any other data access technology.

The DAO implementation is the exactly the one which is tied to a given  
data access technology (so everything else is independent), so you're  
trying to create a two-layer persistence layer. ;) I'm sorry, but it  
doesn't make sense to me.

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

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
Thank you Thiago,

I use that too, but I am trying to de-couple the DAO implementation from the
underlaying database access. Then I would be able to re-use my module (with
its DAOs) with any other data access technology.

Regards,
Matías.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Mon, 11 Jan 2010 17:20:46 -0200, matias.blasi <ma...@gmail.com>  
> escreveu:
> 
>> Anyway, I am thinking on developing some business components, as tapestry
>> modules, which should interact with the underlying database, but I don't
>> want to couple them with neither hibernate nor anyone database  
>> technology, so, I am thinking which is the most standard way to make it  
>> abstract.
> 
> There is one and its widely used: the Data Access Object design pattern  
> (DAO). I use and recommend.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da  
> Informação Ltda.
> http://www.arsmachina.com.br
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27126916.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 11 Jan 2010 17:20:46 -0200, matias.blasi <ma...@gmail.com>  
escreveu:

> Anyway, I am thinking on developing some business components, as tapestry
> modules, which should interact with the underlying database, but I don't
> want to couple them with neither hibernate nor anyone database  
> technology, so, I am thinking which is the most standard way to make it  
> abstract.

There is one and its widely used: the Data Access Object design pattern  
(DAO). I use and recommend.

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

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
Thank you Piero,

I see your point, I am not thinking on changing the database at the middle
of the development process, at least, it isn't my priority.

Anyway, I am thinking on developing some business components, as tapestry
modules, which should interact with the underlying database, but I don't
want to couple them with neither hibernate nor anyone database technology,
so, I am thinking which is the most standard way to make it abstract.

Regards,
Matías.


Piero Sartini-3 wrote:
> 
>> So, do you think that the most flexible approach should be to have some
>> module like tapestry-jpa to interact with into the pages, and, the real
>> "data access layer" implementation could be inter-changable between
>> hibernate, db4o, and anyone which implements the JPA specification?
> 
> If you use JPA, you may switch between the implementations:
> EclipseLink / Toplink, Hibernate, OpenJPA and DataNucleus to name a
> few.
> In practice I have never seen a project changing its underlying
> database.. but well, you may do this with JPA as well.
> 
> For db4o, as it is no relational database I don't think it provides a
> JPA implementation. And if it does, I would not use it - you loose the
> power of object oriented databases by doing so. I've used NeoDatis
> (another OODB) myself and wrote a small plugin equal to tapestry-jpa
> to make its usage more pleasant (injecting ODB service and working
> @CommitAfter). You could take the same approach for db4o.
> 
>          Piero
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27116078.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
> So, do you think that the most flexible approach should be to have some
> module like tapestry-jpa to interact with into the pages, and, the real
> "data access layer" implementation could be inter-changable between
> hibernate, db4o, and anyone which implements the JPA specification?

If you use JPA, you may switch between the implementations:
EclipseLink / Toplink, Hibernate, OpenJPA and DataNucleus to name a
few.
In practice I have never seen a project changing its underlying
database.. but well, you may do this with JPA as well.

For db4o, as it is no relational database I don't think it provides a
JPA implementation. And if it does, I would not use it - you loose the
power of object oriented databases by doing so. I've used NeoDatis
(another OODB) myself and wrote a small plugin equal to tapestry-jpa
to make its usage more pleasant (injecting ODB service and working
@CommitAfter). You could take the same approach for db4o.

         Piero

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


Re: Is tapestry coupled with Hibernate API?

Posted by "matias.blasi" <ma...@gmail.com>.
Thank you all,

So, do you think that the most flexible approach should be to have some
module like tapestry-jpa to interact with into the pages, and, the real
"data access layer" implementation could be inter-changable between
hibernate, db4o, and anyone which implements the JPA specification?

Thanks Piero for your work in tapestry-jpa project!

Regards,
Matías.


Howard Lewis Ship wrote:
> 
> The tapestry-hibernate module is bound to Hibernate, Tapestry itself
> is not.  That's why Tapestry has its own IoC container; to allow for
> such deep integrations.
> 
> On Mon, Jan 11, 2010 at 6:25 AM, Piero Sartini <li...@pierosartini.de>
> wrote:
>> Hi Matias,
>>
>> you may be interested in tapestry-jpa which can be found at
>> http://kenai.com/projects/tapestry-jpa
>>
>> The JPA1 version should work fine, I am using it in all of my projects.
>> I am currently working on the JPA2 version - expect it to be working
>> until the end of the week. I'll try to come up with some documentation
>> of how to use it as well.
>>
>> The module allows you to inject the EntityManager instead of the
>> hibernate Session. You should be able to use every JPA(2) provider
>> with it.
>>
>>        Piero
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator of Apache Tapestry
> 
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
> 
> (971) 678-5210
> http://howardlewisship.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Is-tapestry-coupled-with-Hibernate-API--tp27111015p27115600.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Is tapestry coupled with Hibernate API?

Posted by Howard Lewis Ship <hl...@gmail.com>.
The tapestry-hibernate module is bound to Hibernate, Tapestry itself
is not.  That's why Tapestry has its own IoC container; to allow for
such deep integrations.

On Mon, Jan 11, 2010 at 6:25 AM, Piero Sartini <li...@pierosartini.de> wrote:
> Hi Matias,
>
> you may be interested in tapestry-jpa which can be found at
> http://kenai.com/projects/tapestry-jpa
>
> The JPA1 version should work fine, I am using it in all of my projects.
> I am currently working on the JPA2 version - expect it to be working
> until the end of the week. I'll try to come up with some documentation
> of how to use it as well.
>
> The module allows you to inject the EntityManager instead of the
> hibernate Session. You should be able to use every JPA(2) provider
> with it.
>
>        Piero
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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


Re: Is tapestry coupled with Hibernate API?

Posted by Piero Sartini <li...@pierosartini.de>.
Hi Matias,

you may be interested in tapestry-jpa which can be found at
http://kenai.com/projects/tapestry-jpa

The JPA1 version should work fine, I am using it in all of my projects.
I am currently working on the JPA2 version - expect it to be working
until the end of the week. I'll try to come up with some documentation
of how to use it as well.

The module allows you to inject the EntityManager instead of the
hibernate Session. You should be able to use every JPA(2) provider
with it.

        Piero

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