Hi there,

I have run the Hibernate version of the Tapestry tutorial:
http://tapestry.apache.org/using-tapestry-with-hibernate.html and it works
fine for me.

I am now trying to integrate it with the new 5,3 Tapestry version, running
JPA instead of Hibernate.

I have read instructions at
http://tapestry.apache.org/integrating-with-jpa.html, but I am not sure I
understand how to put the different parts together.

Since I no longer use Hibernate session, I have replaced in Index.java page:

... this code:

           /* @Inject
    private Session session;
            public List<Address> getAddresses()
    {
        return session.createCriteria(Address.class).list();
    }*/

... with this one:

       @PersistenceContext
private EntityManager em;
public List<Address> getAddresses()
{
Query query = em.createQuery("SELECT a FROM Address a");
return query.getResultList();
}

But I am getting this error in <t:grid source="addresses"/> of Index.tml:

Render queue error in SetupRender[Index:grid]: Failure reading parameter
> 'source' of component Index:grid:
> org.apache.tapestry5.ioc.internal.util.TapestryException


Could someone explain what is the issue in the above code?

Also, could someone briefly list/describe the tasks which are needed to
switch the Tapestry tutorial from Hibernate to JPA support.

Regards

Mat

Reply via email to