{"id":14661,"date":"2022-12-29T08:25:22","date_gmt":"2022-12-29T07:25:22","guid":{"rendered":"https:\/\/www.itta.net\/formations\/introduction-to-data-persistence-with-java-persistence\/"},"modified":"2025-08-26T15:39:25","modified_gmt":"2025-08-26T13:39:25","slug":"introduction-to-data-persistence-with-jpa","status":"publish","type":"formations","link":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/","title":{"rendered":"Introduction to Data Persistence with JPA"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The course Introduction to Data Persistence with JPA offers a clear and progressive understanding of the Java Persistence API framework. This training guides you step by step to learn how to manage object persistence in a modern Java application. With this approach, you will understand how to effectively connect your POJO classes to a relational database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-why-learn-jpa-now\">Why learn JPA now<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">JPA technology is based on the concept of object-relational mapping. It simplifies data management and avoids writing complex SQL code. You will discover fundamental concepts such as entities, primary keys, relationships, and the lifecycle of persistent objects. These skills are essential for developing robust and scalable applications.<\/p>\n","protected":false},"featured_media":0,"parent":0,"menu_order":0,"template":"","editeurs":[2627],"domaine":[1262,2825],"class_list":["post-14661","formations","type-formations","status-publish","hentry","editeurs-java-en","domaine-development","domaine-programming-languages"],"acf":{"reference":"JPA","duree_nombre":3,"duree_unite":"jour","prix_virtuel":2150,"prix_presentiel":2300,"prix_blended":"","prix_elearning":"","views":1968,"niveau":["Interm\u00e9diaire"],"role":"","certifiant":"","pdus":"","lieux":["Gen\u00e8ve","Lausanne"],"formats_dapprentissage":["presentiel","virtuel"],"examen_inclus":"Non certifiant","garanti":[""],"financement":["Temptraining"],"description_temptraining":"","description_caf":"","description_title":"Training Introduction to Data Persistence with JPA","objectifs":"<ul>\r\n \t<li>Understand\u00a0how to persist your class POJO's with relational database using JPA Object-Relational mapping technology<\/li>\r\n \t<li>Be confident for implementing and maintaining Object-Relational persistence in your JPA application, including all necessary client-side and server-side programming<\/li>\r\n<\/ul>","connaissances":"<ul>\r\n<li>Have an intermediate knowledge of Java<\/li>\r\n<li>Master the basics of SQL and relational databases<\/li>\r\n<li>Understand the principles of JDBC and building simple web applications<\/li>\r\n<\/ul>\r\n","profils_participants":"<ul>\r\n<li>Beginner Java developers<\/li>\r\n<li>Programmers aiming to master data persistence<\/li>\r\n<li>Computer science students focused on software development<\/li>\r\n<li>Early-career software engineers<\/li>\r\n<\/ul>\r\n","examen":"","documentation":"<ul>\r\n \t<li>Digital courseware included<\/li>\r\n<\/ul>","lab__exercices":"","contenu_cours":"<strong>Module 1: Introduction to the Java Persistence API (JPA)<\/strong>\r\n<ul>\r\n<li>Persistence layers, object-relational mapping (ORM), JDBC<\/li>\r\n<li>Overview of JPA<\/li>\r\n<li>Entities and @Entity, ids and @Id<\/li>\r\n<li>Generated ID values<\/li>\r\n<li>Basic mapping types<\/li>\r\n<li>Persistence to the database, the EntityManager API<\/li>\r\n<li>Persistence units, configuration, persistence context<\/li>\r\n<li>Finding persistent entities with find()<\/li>\r\n<li>Default mappings, @Basic, @Column<\/li>\r\n<li>Field vs Property Access<\/li>\r\n<li>Temporal mappings (date \/ time)<\/li>\r\n<li>Logging options (provider-based)<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 2: Updates and Queries<\/strong>\r\n<ul>\r\n<li>New persistent entities, update and delete<\/li>\r\n<li>Entity-based queries, SELECT, WHERE<\/li>\r\n<li>Query interface, execution and generic queries<\/li>\r\n<li>JPQL operators, expressions and parameters<\/li>\r\n<li>Named queries<\/li>\r\n<li>Projection, ordering, aggregation, update and delete<\/li>\r\n<li>@Embeddable, @Embedded and embedded objects<\/li>\r\n<li>Composite primary keys with @EmbeddedID and @IDClass<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 3: The Persistence Lifecycle<\/strong>\r\n<ul>\r\n<li>Overview of the Transaction API<\/li>\r\n<li>EntityTransaction, JTA and Resource-local EntityManager<\/li>\r\n<li>JPA entity states and state diagram<\/li>\r\n<li>Persistence context and synchronization<\/li>\r\n<li>Version, @Version and optimistic locking<\/li>\r\n<li>@PrePersist, @PostPersist and Entity Listeners<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 4: Entity Relationships<\/strong>\r\n<ul>\r\n<li>Object relationships, roles, directionality and cardinality<\/li>\r\n<li>@ManyToOne, @OneToMany, @ManyToMany, @OneToOne<\/li>\r\n<li>Unidirectional and bidirectional relationships<\/li>\r\n<li>Collection types and cascading<\/li>\r\n<li>Inner joins, outer joins and fetch joins<\/li>\r\n<li>Entity inheritance mapping<\/li>\r\n<li>Single table, joined and concrete class mapping<\/li>\r\n<li>Value object collections with @ElementCollection<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 5: The Criteria API (JPA 2)<\/strong>\r\n<ul>\r\n<li>Overview of the Criteria API<\/li>\r\n<li>CriteriaBuilder, CriteriaQuery, Subquery and Predicate<\/li>\r\n<li>Executing queries and retrieving results<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 6: Additional JPA Capabilities<\/strong>\r\n<ul>\r\n<li>XML Mapping files<\/li>\r\n<li>Bean Validation<\/li>\r\n<li>Primary keys, named queries and lazy loading<\/li>\r\n<li>Transactional semantics and encapsulation<\/li>\r\n<li>Report queries and best practices<\/li>\r\n<\/ul>\r\n\r\n<strong>Module 7: Integration<\/strong>\r\n<ul>\r\n<li>DAO integration and EntityManager management in Java SE<\/li>\r\n<li>Using JPA with EJB session beans<\/li>\r\n<li>JTA transactions and extended persistence contexts<\/li>\r\n<li>EntityManager in web applications<\/li>\r\n<li>Lazy loading and Open EntityManager<\/li>\r\n<li>Integration with Spring and EntityManager injection<\/li>\r\n<\/ul>\r\n","cours_recommandes":[14659,14610],"infos_additionnelles":"<h3>JPA, an essential tool for Java developers<\/h3>\r\nManaging data persistence is a major challenge in any software project. Developers must ensure consistency between their Java objects and the data stored in a relational database. Without a dedicated tool, this task involves a lot of complex and repetitive code. This is where JPA comes in. As a standard specification, it helps unify and simplify the process. By adopting it, companies reduce maintenance costs and improve the quality of their applications.\r\n<h3>The practical benefits of data persistence<\/h3>\r\nUsing JPA is not limited to simplifying code writing. This framework brings real value to projects. It makes applications more scalable and easier to maintain. The clear separation between business logic and data access facilitates future evolutions. Developers can focus on features instead of managing complex SQL queries. This abstraction also reduces the risk of errors and improves application security.\r\n<h3>Understanding entities and their lifecycle<\/h3>\r\nAt the heart of JPA are entities. These are Java classes directly associated with database tables. Understanding their lifecycle is essential for any developer. An entity can be new, managed, detached, or removed. Each state has a direct impact on how the application interacts with the database. By mastering this mechanism, a programmer can precisely control transactions and avoid data inconsistencies.\r\n<h3>The power of object relationships<\/h3>\r\nIn a real project, it is rare to manipulate isolated objects. Applications often require complex relationships, such as a customer linked to multiple orders. JPA provides complete management of these associations with simple annotations such as @OneToMany or @ManyToOne. These relationships make it possible to faithfully represent the business model in the database. For development teams, this means better readability and code closer to the functional reality.\r\n<h3>Building effective queries with JPQL and the Criteria API<\/h3>\r\nAn application cannot function without queries. With JPA, two main approaches are possible. The first uses JPQL, a language close to SQL but object-oriented. The second relies on the Criteria API, which allows dynamically generating queries via Java code. This flexibility is valuable for applications requiring complex or evolving filters. By mastering these tools, a developer can create powerful and high-performance solutions tailored to business needs.\r\n<h3>Optimizing performance with best practices<\/h3>\r\nData persistence should not compromise application performance. JPA provides several mechanisms to optimize processing. Lazy loading prevents unnecessarily retrieving large amounts of data. Optimistic locking ensures efficient management of concurrent access without unnecessarily blocking users. Developers also discover the benefits of second-level caching and named queries. These techniques help reduce database load and improve overall responsiveness.\r\n<h3>A framework suited to modern environments<\/h3>\r\nJPA integrates naturally into different contexts. It works equally well in a standalone Java SE application as in a web application based on enterprise servers. It pairs perfectly with frameworks like Spring, which facilitate transaction management and dependency injection. Thanks to this flexibility, it is used in a wide variety of projects, from small internal applications to large-scale critical solutions.\r\n<h3>Why learning JPA is a professional asset<\/h3>\r\nMastering JPA is a sought-after skill in the world of Java development. Companies value profiles capable of designing reliable and maintainable applications. Taking a JPA training course provides solid knowledge directly applicable in the workplace. It also prepares developers for advanced Java certifications. Finally, this expertise opens the way to more specialized positions, such as application architect or senior software engineer.\r\n<h3>FAQ<\/h3>\r\n<strong>Is JPA a framework or a specification?<\/strong>\r\nJPA is a specification. It defines a standard, and several frameworks such as Hibernate or EclipseLink are its implementations.\r\n\r\n<strong>What is the difference between JPA and Hibernate?<\/strong>\r\nHibernate is an implementation of JPA. Learning JPA therefore allows you to use Hibernate, but also other compatible solutions.\r\n\r\n<strong>Can JPA be used in microservices?<\/strong>\r\nYes, JPA is compatible with modern architectures. It integrates easily with Spring Boot, which is widely used for microservices.\r\n\r\n<strong>What are the main advantages of JPA?<\/strong>\r\nJPA reduces code complexity, improves productivity, and ensures better consistency between objects and the database.","inclus_dans_ce_cours_virtuel":"<ul>\r\n \t<li>Training provided by an industry expert<\/li>\r\n \t<li>Digital documentation and materials<\/li>\r\n \t<li>Achievement badge<\/li>\r\n<\/ul>","inclus_dans_ce_cours_presentiel":"<ul>\r\n \t<li>Training provided by an industry expert<\/li>\r\n \t<li>Digital documentation and materials<\/li>\r\n \t<li>Achievement badge<\/li>\r\n<\/ul>","inclus_dans_ce_cours_blended":"","inclus_dans_ce_cours_elearning":"","inclus_dans_ce_cours_surmesure":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Introduction to Data Persistence with JPA - ITTA<\/title>\n<meta name=\"description\" content=\"JPA Training: Learn data persistence in Java. Master entities, queries, and relationships for your projects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/introduction-to-data-persistence-with-jpa\\\/\",\"url\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/introduction-to-data-persistence-with-jpa\\\/\",\"name\":\"Introduction to Data Persistence with JPA - ITTA\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#website\"},\"datePublished\":\"2022-12-29T07:25:22+00:00\",\"dateModified\":\"2025-08-26T13:39:25+00:00\",\"description\":\"JPA Training: Learn data persistence in Java. Master entities, queries, and relationships for your projects.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/introduction-to-data-persistence-with-jpa\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/introduction-to-data-persistence-with-jpa\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/introduction-to-data-persistence-with-jpa\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itta.net\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Development\",\"item\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Programming languages\",\"item\":\"https:\\\/\\\/www.itta.net\\\/en\\\/trainings\\\/development\\\/programming-languages\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Introduction to Data Persistence with JPA\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.itta.net\\\/en\\\/\",\"name\":\"ITTA\",\"description\":\"Formations &amp; Certifications en Suisse Romande\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itta.net\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Organization\",\"EducationalOrganization\"],\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#organization\",\"name\":\"ITTA\",\"alternateName\":\"IT TRAINING ACADEMY SA\",\"url\":\"https:\\\/\\\/www.itta.net\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.itta.net\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Logo-transparent.png\",\"contentUrl\":\"https:\\\/\\\/www.itta.net\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Logo-transparent.png\",\"width\":1500,\"height\":623,\"caption\":\"ITTA\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itta.net\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/people\\\/ITTA\\\/100063747262936\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/1001738\",\"https:\\\/\\\/www.instagram.com\\\/itta_suisse\\\/\"],\"contactPoint\":{\"@type\":\"ContactPoint\",\"telephone\":\"+41 58 307 73 00\",\"contactType\":\"customer service\",\"availableLanguage\":[\"French\",\"English\"],\"areaServed\":[{\"@type\":\"Country\",\"name\":\"Switzerland\"},{\"@type\":\"Country\",\"name\":\"France\"}]},\"location\":[{\"@type\":\"Place\",\"name\":\"ITTA Geneve\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"Route des Jeunes 35\",\"addressLocality\":\"Carouge\",\"postalCode\":\"1227\",\"addressRegion\":\"GE\",\"addressCountry\":\"CH\"},\"geo\":{\"@type\":\"GeoCoordinates\",\"latitude\":46.18274,\"longitude\":6.12922}},{\"@type\":\"Place\",\"name\":\"ITTA Lausanne\",\"address\":{\"@type\":\"PostalAddress\",\"streetAddress\":\"Rue des Cotes-de-Montbenon 16\",\"addressLocality\":\"Lausanne\",\"postalCode\":\"1003\",\"addressRegion\":\"VD\",\"addressCountry\":\"CH\"},\"geo\":{\"@type\":\"GeoCoordinates\",\"latitude\":46.52111,\"longitude\":6.62734}}]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introduction to Data Persistence with JPA - ITTA","description":"JPA Training: Learn data persistence in Java. Master entities, queries, and relationships for your projects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/","url":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/","name":"Introduction to Data Persistence with JPA - ITTA","isPartOf":{"@id":"https:\/\/www.itta.net\/en\/#website"},"datePublished":"2022-12-29T07:25:22+00:00","dateModified":"2025-08-26T13:39:25+00:00","description":"JPA Training: Learn data persistence in Java. Master entities, queries, and relationships for your projects.","breadcrumb":{"@id":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/introduction-to-data-persistence-with-jpa\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itta.net\/en\/"},{"@type":"ListItem","position":2,"name":"Development","item":"https:\/\/www.itta.net\/en\/trainings\/development\/"},{"@type":"ListItem","position":3,"name":"Programming languages","item":"https:\/\/www.itta.net\/en\/trainings\/development\/programming-languages\/"},{"@type":"ListItem","position":4,"name":"Introduction to Data Persistence with JPA"}]},{"@type":"WebSite","@id":"https:\/\/www.itta.net\/en\/#website","url":"https:\/\/www.itta.net\/en\/","name":"ITTA","description":"Formations &amp; Certifications en Suisse Romande","publisher":{"@id":"https:\/\/www.itta.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itta.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Organization","EducationalOrganization"],"@id":"https:\/\/www.itta.net\/en\/#organization","name":"ITTA","alternateName":"IT TRAINING ACADEMY SA","url":"https:\/\/www.itta.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.itta.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.itta.net\/wp-content\/uploads\/2023\/02\/Logo-transparent.png","contentUrl":"https:\/\/www.itta.net\/wp-content\/uploads\/2023\/02\/Logo-transparent.png","width":1500,"height":623,"caption":"ITTA"},"image":{"@id":"https:\/\/www.itta.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/people\/ITTA\/100063747262936\/","https:\/\/www.linkedin.com\/company\/1001738","https:\/\/www.instagram.com\/itta_suisse\/"],"contactPoint":{"@type":"ContactPoint","telephone":"+41 58 307 73 00","contactType":"customer service","availableLanguage":["French","English"],"areaServed":[{"@type":"Country","name":"Switzerland"},{"@type":"Country","name":"France"}]},"location":[{"@type":"Place","name":"ITTA Geneve","address":{"@type":"PostalAddress","streetAddress":"Route des Jeunes 35","addressLocality":"Carouge","postalCode":"1227","addressRegion":"GE","addressCountry":"CH"},"geo":{"@type":"GeoCoordinates","latitude":46.18274,"longitude":6.12922}},{"@type":"Place","name":"ITTA Lausanne","address":{"@type":"PostalAddress","streetAddress":"Rue des Cotes-de-Montbenon 16","addressLocality":"Lausanne","postalCode":"1003","addressRegion":"VD","addressCountry":"CH"},"geo":{"@type":"GeoCoordinates","latitude":46.52111,"longitude":6.62734}}]}]}},"_links":{"self":[{"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/formations\/14661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/formations"}],"about":[{"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/types\/formations"}],"acf:post":[{"embeddable":true,"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/formations\/14610"},{"embeddable":true,"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/formations\/14659"}],"wp:attachment":[{"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/media?parent=14661"}],"wp:term":[{"taxonomy":"editeurs","embeddable":true,"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/editeurs?post=14661"},{"taxonomy":"domaine","embeddable":true,"href":"https:\/\/www.itta.net\/en\/wp-json\/wp\/v2\/domaine?post=14661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}