Summary
In this chapter we discussed just enough of the basics of the Java Persistence API to develop and run a simple application in a Java SE runtime.
We started out discussing the entity, how to define one, and how to turn an existing Java class into one. We discussed entity managers and how they are obtained and constructed in the Java SE environment.
The next step was to instantiate an entity instance and use the entity manager to persist it in the database. After we inserted some new entities, we were able to retrieve them again and then remove them. We also made some updates and ensured that the changes were written back to the database.
We talked about the resource-local transaction API and how to use it. We then went over some of the different types of queries and how to define and execute them. Finally, we aggregated all of these techniques and combined them into a simple application that we can execute in isolation from an enterprise environment.
In the next chapter, we will look at the impact of the Java EE environment when developing enterprise applications using the Java Persistence API.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Peter C. Chen, “The entity-relationship model—toward a unified view of data,” ACM Transactions on Database Systems 1, no. 1 (1976): 9–36.
Rights and permissions
Copyright information
© 2006 Mike Keith and Merrick Schincariol
About this chapter
Cite this chapter
(2006). Getting Started. In: Pro EJB 3. Apress. https://doi.org/10.1007/978-1-4302-0168-7_2
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0168-7_2
Publisher Name: Apress
Print ISBN: 978-1-59059-645-6
Online ISBN: 978-1-4302-0168-7
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)