Reader small image

You're reading from  Java EE 7 Development with NetBeans 8

Product typeBook
Published inJan 2015
Reading LevelIntermediate
PublisherPackt
ISBN-139781783983520
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
David R Heffelfinger
David R Heffelfinger
author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger

Right arrow

Generating session beans from JPA entities


One very nice NetBeans feature is that it allows the generation of stateless session beans from the existing JPA entities. The generated session beans act as Data Access Objects (DAOs). This feature, combined with the ability to generate JPA entities from an existing database schema, allows us to completely generate the data access layers of our application without having to write a single line of Java code.

To take advantage of this functionality, we need to create an EJB project (go to File | New Project, select Enterprise from the Categories list, select EJB Module from the Projects list), or use the EJB project from an Enterprise Application project and add some JPA entities to it either by manually coding them or by generating them from an existing schema as discussed in Chapter 4, Interacting with Databases through the Java Persistence API.

Once we have some JPA entities in the project, we need to go to File | New File, select Persistence from...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Java EE 7 Development with NetBeans 8
Published in: Jan 2015Publisher: PacktISBN-13: 9781783983520

Author (1)

author image
David R Heffelfinger

David Heffelfinger is the Chief Technology Officer of Ensode Technology, LLC, a software consulting firm based in the greater Washington DC area. He has been architecting, designing, and developing software professionally since 1995, and has been using Java as his primary programming language since 1996. He has worked on many large-scale projects for several clients including the US Department of Homeland Security, Freddie Mac, Fannie Mae, and the US Department of Defense. He also has a Masters degree in Software Engineering from Southern Methodist University. David is Editor-in-Chief of Ensode.net (http://www.ensode.net), a website about Java, Linux, and other technology topics.
Read more about David R Heffelfinger