Java Persistence/What is Java persistence?

From Wikibooks, open books for an open world
Jump to: navigation, search

Java persistence could be defined as storing anything to any persistence store in the Java programming language. Obviously this would be too broad of a concept for a single book, so this book is more focused on storing Java objects to relational databases. In particular using the Java Persistence API (JPA).

There are many ways to persist data in Java, to name a few, JDBC, serialization, file IO, JCA, object databases, or XML databases. However the majority of data in general is persisted in databases, specifically relational databases. Most things that you do on a computer or web site that involve storing data, involve accessing a relational database. Relational databases are the standard persistence store for most corporations from banking to industrial.

There are many things that can be stored in databases from Java. Java data includes strings, numbers, dates and byte arrays, images, XML and Java objects. Many Java applications use Java objects to model their application data, because Java is an Object Oriented language, storing Java objects is a natural and common approach to persisting data from Java.

There are many ways to access a relational database from Java, JPA is just the latest of many different specifications, but seems to be the direction that Java persistence is heading.

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
Sister projects
Print/export