Re: jpa: query and transaction

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Mar 03 2006 - 05:45:50 EST

  • Next message: Tore Halset: "Re: jpa: query and transaction"

    Cool. I'll hopefully catch up on the TCK setup (CAY-458) so that we
    could setup real unit tests.

    > At last, one maven newbie question. How can I build a jar-file from
    > the cayenne-jpa project?

    1. to build a jar: mvn package
    2. to build and intsall it in a local repo: mvn install

    Andrus

    On Mar 3, 2006, at 1:39 PM, Tore Halset wrote:

    > Hello.
    >
    > I just checked in a implementation of EntityManager.createNamedQuery
    > (String name) and a jpa EntiryTransaction that wrapps around a
    > cayenne transaction.
    >
    > I have used this to switch out DataContext with EntityManager in a
    > small project here. It is a ultra-simple tapestry4 interface for
    > managing users for the james mailserver. Just adding/editing/
    > deleting users. All queries are (now) done using named queries.
    >
    > How are the EntityManager are supposed to be created? Perhaps we
    > need a connection between PersistenceUnitInfo and cayenne? And how
    > should we provide jpa with a transaction? This is what I am
    > currently doing in tapestry-visit.
    >
    > // TODO: do this the correct way
    > PersistenceUnitInfo pui = new MockPersistenceUnitInfo();
    > EntityManagerFactory emf = new CjpaEntityManagerFactory
    > (pui);
    > EntityManager em = emf.createEntityManager();
    > // TODO: how to do transaction stuff?
    > ((JpaEntityManager) em).setTransaction(new
    > CjpaEntityTransaction(Transaction
    > .noTransaction()));
    >
    > At last, one maven newbie question. How can I build a jar-file from
    > the cayenne-jpa project?
    >
    > Regards,
    > - Tore.
    >



    This archive was generated by hypermail 2.0.0 : Fri Mar 03 2006 - 05:45:54 EST