Java Persistence API part 1 INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J

Slides:



Advertisements
Similar presentations
Persistence Jim Briggs 1. 2 Database connectivity: JDBC Java Database Connectivity An API for connecting Java programs (applications, applets and servlets)
Advertisements

Course Introduction INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
1 Assignment 4 Map entities with relationships to relational schemas. Use DBDL to describe the table schemas.
Java Persistence API part 2 INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
JBoss Seam: Contextual Components Jason Bechtel
Introduction to Enterprise JavaBeans. Integrating Software Development Server-side Component Model Distributed Object Architecture –CORBA –DCOM –Java.
Entities and Persistence. Entity Beans Topics to be Covered: Entities are POJOs Managed/Unmanaged Entities Persistence Unit EntityManager Basic Relational.
Introduction to EJB INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
APPENDIX C DESIGNING DATABASES
WJEC Applied ICT Databases – Attributes & Entities Entities A database contains one or more related tables. Each table holds all of the information.
1 Lecture 18 George Koutsogiannakis/Spring 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
The Java Persistence API Edel Sherratt. Contents Revisit applications programming Using Java Persistence API.
Java Persistence API Maciej Adamiak. Agenda -Entity, -Entity Operations, -Query Language.
Rice KRAD Data Layer JPA Design Eric Westfall July 2013.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
2007 JavaOne SM Conference | Session BOF-4181 | BOF-4181 Migrating a Spring/Hibernate Application to Java Platform, Enterprise Edition (Java EE) 5 Adrian.
Database Design Concepts
1 Lecture 17 George Koutsogiannakis/SUMMER 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
JPA Java Persistence API. Introduction The Java Persistence API provides an object/relational mapping facility for managing relational data in Java applications.
IS-907 Java EE JPA: Simple Object-Relational Mapping.
Container-Managed Persistence (CMP) Entity Beans Lesson 3A / Slide 1 of 42J2EE Server Components Objectives In this lesson, you will learn to: Identify.
Enterprise JavaBeans. What is EJB? l An EJB is a specialized, non-visual JavaBean that runs on a server. l EJB technology supports application development.
Session Beans INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Dali JPA Tools. About Dali Dali JPA Tools is an Eclipse Web Tools Platform sub-Project Dali 1.0 is a part of WTP 2.0 Europa coordinated release Goal -
Geodatabase Relationships & Relationship Classes GIS 458 Spring 2006 Larry Clamp.
CS 157B: Database Management Systems II February 4 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
Topic : JPA Kaster Nurmukan. Overview of JPA EntityManager.
EJB 3.0 Persistence Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
1 Persistence in Java Enterprise Container Managed Persistence Application Managed Persistence Michael Brockway Sajjad Shami CG0165: Advanced Applications.
Access Review. Access Access is a database application A database is a collection of records and files organized for a particular purpose Access supports.
Jozef Kuper.  Describe a Database  Entities  Atributes  Relationships.
In this session, you will learn to: Map an ER diagram to a table Objectives.
Middleware Technology (J2EE/EJB) Entity Bean (JBoss EJB 3.0 tutorial)
Topic : Hibernate 3:Advanced ORM Kaster Nurmukan.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
1 DATABASE TECHNOLOGIES (Part 2) BUS Abdou Illia, Fall 2015 (September 9, 2015)
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin APPENDIX C DESIGNING DATABASES APPENDIX C DESIGNING DATABASES.
1 ER Modeling BUAD/American University Mapping ER modeling to Relationships.
The Java Persistence API ©SoftMoore ConsultingSlide 1.
March 1, 2004CS WPI1 CS 509 Design of Software Systems Lecture #6 Monday, March 1, 2004.
Understand Relational Database Management Systems Software Development Fundamentals LESSON 6.1.
v110912Java Persistence: EntityManager2 Overview Earlier versions of EJB Specification defined the persistence layer –javax.ejb.EntityBean Java EE 5 moved.
Java Persistence API (JPA) Relationships. Kinds of relationships UML associations and aggregations (ER non- identifying relationships, shared semantics)
Mapping Objects ↔Relational DB. The Problem with Databases Databases store data in rows in tables, which are not like objects. We can simulate object.
Programmation des Applications Internet Internet Application Programming © - Last update: Friday, 05 February
JPA The New Enterprise Persistence Standard Mike Keith
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
IS-907 Java EE Introduction to JPA. Java Persistence API A framework for using relational databases in Java programs mapping between tables and classes,
JPA in Vaadin CSCI 3130 Winter What is JPA?  Java Persistence API  Allows for “easy” storage of Java Objects  Is a type of Object Relational.
Hibernate Thuy, Le Huu. Pentalog VN. Agenda Hibernate Annotations Improving performance – Lazy loading – Fetching Strategies – Dynamic insert, dynamic.
Microsoft Access CS 110 Fall Entity Relationship Model Entities Entities Principal data object about which information is to be collectedPrincipal.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA (I) Chengyu Sun California State University, Los Angeles.
Hibernate Annotation 李日貴 (jini) jakarta99 AT gmail.com SoftLeader Tech. Corp. Taiwan Java Annotation Lesson 1.
1 EJB 3.0: There’s Something Different About You Martin Jäkle, TSBU Middleware.
CS520 Web Programming Object-Relational Mapping with Hibernate and JPA Chengyu Sun California State University, Los Angeles.
Don't Know Jack About Object-Relational Mapping?
CS6320 – Java Persistence API
Chengyu Sun California State University, Los Angeles
Advanced Java Programming
Entity Framework By: Casey Griffin.
JPA: Mapping to an existing database
Chengyu Sun California State University, Los Angeles
Developing and testing enterprise Java applications
CS4961 Software Design Laboratory Understand Aquila Backend
Topics Persistence API for JAVA EE5 Java Transaction API Entity class.
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Java Persistence API part 1 INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J

Agenda  O/R Mapping  Primary entity annotations  EntityManager  Entity Relationships  Practice

O/R Mapping Database Table POJO Forward Engineering Reverse Engineering Java Persistence API

Primary Entity Annotations Mark class as an entity Define primary key Define composite key Define table name for entity class. Define column property. Ignored by persistence framework.  Autopopulate column with sequence generator.

EntityManager  Maintains a cache of instances within a transactional context (persistence context)  We can acquire EntityManager instance using :  Dependency Injection  EntityManagerFactory  JNDI Lookup  Operations : persist(), merge(), remove(), find(), createNamedQuery(), createQuery()  Persistence unit is declared in persistence.xml

Entity Relationships One to One is represented by a single-value entity reference at one or both ends of the relationship This annotation is added to a Collection relationship field. Indicating that is an entity is part of a Collection This annotation is assigned to a Collection relationship field to indicate the target entity also has a Collection of the source entity type.  Lazy vs Eager Binding  Cascade (ALL, PERSIST, MERGE, REMOVE, REFRESH)

Practice  You can get entity beans by reverse engineering with Netbeans IDE.  Demo in EntityBeansDemo.zipEntityBeansDemo.zip

References  Beginning EJB 3 Application Development, Apress