File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes JPA with JSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA with JSF" Watch "JPA with JSF" New topic
Author

JPA with JSF

zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 19
Hi there

I want to create a JSF project with JPA. I am using eclipse 3.5. How can I integrate both in one project?
I read somewhere that keeping JSF and JPA project separately is a good practice, but I don't know how to do this. If I am using two different projects that is for JSF one project and JPA another how do I integrate and make it working depending on each other?

Please give me some inputs.
Rishi Shehrawat
Ranch Hand

Joined: Aug 11, 2010
Posts: 218

Create project for JPA & another one for JSF. Since JSF will be using JPA add a dependency between JSF & JPA, can be done via adding to java build path of project
zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 19
Hi Rishi
Thank for the reply.

I have created two different projects for JPA and JSF and have connected by build path. Have to work on the entity manager part, which I want to use in my JSF project. Will work on that and get back.
zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 19
Hi there.

I tried by creating two different projects for JPA and JSF. Wrote build.xml for both to have the class path entry properly.
But I am getting this error:

Here is what exactly I am doing:
JPA Test (its a project): in which JPA is configured and the persistence.xml is written
persistence.xml:

In the source of this project I have the persistence classes and a connection class.
Connection Class:

The next Project is for JSF which is call RackRate. This has all the JSF capability. Now in my jsp I am calling one bean called RackRateAction.
It contains:

Can you suggest me where i m going wrong?

zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 19
Hi there.

Now I tried both JPA and JSF in one project and it is working now

Check these site for more help:
http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html_single/#d0e46
[url]
http://download.oracle.com/docs/cd/B31017_01/web.1013/b28221/cfgdepds005.htm#TopLinkJDBC[/url]
[url]
http://www.gregbugaj.com/?p=172&cpage=1#comment-236[/url]

Enjoy
Venkat basa
Greenhorn

Joined: Oct 30, 2012
Posts: 9
hi,

please create a jsf(Dynamic web project)

and go to your project properties(jsf project)

select Project Facets

in that wizard,select Jpa

then press OK,now your project is configure with jsf+jpa

Venkat
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA with JSF