Results 1 to 2 of 2
  1. #1
    FlyNn is offline Senior Member
    Join Date
    Feb 2010
    Posts
    128
    Rep Power
    0

    Default Persistence API with Java SE?

    Hi all Java EE fans.

    I am not sure if I am posting in the correct section, so apologies to the moderators.

    Anyway. I've been messing with Glassfish and building some simple applications using JavaEE.

    Love the Persistence API by the way. So I thought it could be cool to implement Persistence API into current applications at work. The software at work is built on SE and access to the database records is very messy, so that's another reason why I would like to incorporate the Persistence API.

    The way I do it is, create a project(Objects) and in that project create POJOs (Customer, Order, blah blah blah). Then I build all of that into a .jar file and add it as a library into projects where I would need them.

    So the question I have is:
    1. For the Persistence API to work it needs the persistence.xml in META-INF folder which I have. But does it need to be in the Objects.jar where POJOs are located or in the actual application project where the Objects.jar is added as a library?

    Thanks :)

    EDIT: Maybe a second question to make things clearer for myself: Could I even use Persistence API without an application server?
    Last edited by FlyNn; 08-18-2011 at 07:40 PM.
    Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

  2. #2
    swapnasangal is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: Persistence API with Java SE?

    Hi,

    How are you creating the pojo objects, is it using some standard tool to generate entities from the database tables, if it is so then as you said you hav the persistent.xml and the dao objects to access those entities.

    Yes we need to hav the persistence.xml in Objects.jar to access those entities, it not only contains the entity classes in it but also the information regarding the datasource.

Similar Threads

  1. Replies: 0
    Last Post: 03-08-2009, 02:52 PM
  2. Hibernate Java Persistence
    By JavaBean in forum Java Tutorial
    Replies: 0
    Last Post: 09-22-2007, 11:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •