Results 1 to 2 of 2
Thread: Persistence API with Java SE?
- 08-18-2011, 05:07 PM #1
Senior Member
- Join Date
- Feb 2010
- Posts
- 128
- Rep Power
- 0
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 06:40 PM.
Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
- 02-14-2012, 10:47 PM #2
Member
- Join Date
- Dec 2011
- Posts
- 2
- Rep Power
- 0
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
-
Persistence problem when changing type to java.sql.Time
By Inks in forum JDBCReplies: 0Last Post: 03-08-2009, 01:52 PM -
Hibernate Java Persistence
By JavaBean in forum Java TutorialReplies: 0Last Post: 09-22-2007, 10:02 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks