JPA in Vaadin CSCI 3130 Winter 2016. What is JPA?  Java Persistence API  Allows for “easy” storage of Java Objects  Is a type of Object Relational.

Slides:



Advertisements
Similar presentations
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
Advertisements

ISP 121 Access Normalization and Relationships. Normalization Say we’re operating a pet day-care and we need to keep information on our pets/customers.
COMPREHENSIVE Access Tutorial 2 Building a Database and Defining Table Relationships.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
Session-02.
Page 1 ISMT E-120 Introduction to Microsoft Access & Relational Databases The Influence of Software and Hardware Technologies on Business Productivity.
The Java Persistence API Edel Sherratt. Contents Revisit applications programming Using Java Persistence API.
Database Relationships Objective 5.01 Understand database tables used in business.
Data Persistence and Object-Relational Mapping Slides by James Brucker, used with his permission 1.
CIS 764 Kansas State University
Hibernatification! Roadmap for Migrating from Plain Old SQL on JDBC to JPA on Hibernate Duke Banerjee Senior Developer, DrillingInfo.com.
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.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Maven for building Java applications By Nalin De Zoysa
JPA Java Persistence API. Introduction The Java Persistence API provides an object/relational mapping facility for managing relational data in Java applications.
Tutorial 8 Advanced Queries. Notes Switch to new database! Tutorial.08 folder Only Session 8.1 and 8.2.
Eric Westfall – Indiana University Jeremy Hanson – Iowa State University Building Applications with the KNS.
NHibernate in Action Web Seminar at UMLChina By Pierre Henri Kuaté 2008/08/27
IS-907 Java EE JPA: Simple Object-Relational Mapping.
Object persistence with Hibernate in Decision Deck 1.1 Gilles Dodinet 2 nd Decision Deck Workshop 2008, February.
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
RELATIONSHIPS Generally there are two main database types: flat-file and relational.
Seminar on. Overview Hibernate. What is it? Hibernate. How does it work? Hibernate Tools.
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 -
® Microsoft Office 2010 Access Tutorial 2 Building a Database and Defining Table Relationships.
Topic : JPA Kaster Nurmukan. Overview of JPA EntityManager.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Inventory Control System Design and Object Documentation By Group #2 1. Andrew Hussie - Prototype Demonstration 2. Arnold Herrera (Project Manager) – System.
(1) Introduction to Models using the Play Framework Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University.
An Entity Relationship (ER) Diagram is a graphic that shows the interrelationship between entities in a database.
MCS 270 Spring 2014 Object-Oriented Software Development.
Topic : Hibernate 3:Advanced ORM Kaster Nurmukan.
File and Database Design Class 22. File and database design: 1. Choosing the storage format for each attribute from the logical data model. 2. Grouping.
MS Access and Database Connections. Pre-work To make our program work seamlessly, first we have to make a small change on the database table.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool The problem fixed by ORM Advantage Hibernate Hibernate Basic –Hibernate sessionFactory –Hibernate Session.
Microsoft Access Introduction. What is a database? A DATABASE is a collection of related data.
Java Persistence API part 1 INFORMATICS ENGINEERING – UNIVERSITY OF BRAWIJAYA Eriq Muhammad Adams J
By Srinivas Mahakud Java Persistence API JPA. Review Topics: Introduction what is the JPA? What is the JPA contains of? Why developers should Create the.
Java Persistence API (JPA) Relationships. Kinds of relationships UML associations and aggregations (ER non- identifying relationships, shared semantics)
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Topic : Hibernate 1 Kaster Nurmukan. An ORM tool Used in data layer of applications Implements JPA.
Simplifying the Code First Approach in the Entity Framework Dhananjay Kumar Infragistics Consultant Microsoft MVP
IS-907 Java EE Introduction to JPA. Java Persistence API A framework for using relational databases in Java programs mapping between tables and classes,
.  A reference model developed for an important use case (Air Job) including UI widgets, controllers, services and DAOs.  After full requirement analysis.
JPA Java Persistence API JAVA Enterprise Edition
 Who I am  What is NHibernate? ◦ Object Relational Mapper ◦ A framework for building advanced frameworks ◦ Ported from Java ◦ A wide NHibernate ecosystem.
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.
Chengyu Sun California State University, Los Angeles
Creating a database table
Database Mysql Hayk Avdalyan.
A very brief introduction
Chengyu Sun California State University, Los Angeles
Advanced Java Programming
Entity Framework By: Casey Griffin.
Database Applications (15-415) ORM - Part I Lecture 11, February 11, 2018 Mohammad Hammoud.
Learning about Database Systems Yahya Alhawsawi Hani Alqaffas CSCI 152.
Testing a persistence layer
MS Access and Database Connections
JPA: Mapping to an existing database
Data Models.
Chengyu Sun California State University, Los Angeles
Developing and testing enterprise Java applications
CS4961 Software Design Laboratory Understand Aquila Backend
Chengyu Sun California State University, Los Angeles
Presentation transcript:

JPA in Vaadin CSCI 3130 Winter 2016

What is JPA?  Java Persistence API  Allows for “easy” storage of Java Objects  Is a type of Object Relational Mapping (ORM) framework  Book of Vaadin: /part/framework/jpacontainer/jpacontainer- overview.htmlhttps://vaadin.com/docs/- /part/framework/jpacontainer/jpacontainer- overview.html  Java Persistence API  Allows for “easy” storage of Java Objects  Is a type of Object Relational Mapping (ORM) framework  Book of Vaadin: /part/framework/jpacontainer/jpacontainer- overview.htmlhttps://vaadin.com/docs/- /part/framework/jpacontainer/jpacontainer- overview.html

How does it work? Your ObjectsYour UI JPA Database

How do I use it?  Carefully! 1.Update ivy.xml 2.Change Project Facet 3.Edit persistence.xml 4.Define Data Model 5.Connect JPA to UI  Carefully! 1.Update ivy.xml 2.Change Project Facet 3.Edit persistence.xml 4.Define Data Model 5.Connect JPA to UI

1. Update ivy.xml

Update ivy.xml  Add these lines to ivy.xml:  Save and wait for the new libraries to download  Add these lines to ivy.xml:  Save and wait for the new libraries to download

2. Add Project Facet

Add Project Facet

Edit Persistence.xml

Edit persistence.xml  persistence.xml tells JPA how to connect to the database  By default it is in src/META-INF/persistence.xml  persistence.xml tells JPA how to connect to the database  By default it is in src/META-INF/persistence.xml

Edit persistence.xml

4. Define Data Model

Define Data Model  Create the classes to hold your data  Annotate data classes  Annotate id field  Annotate @ManyToMany, etc…  For reciprocal relationships, make sure to use mappedBy  Create the classes to hold your data  Annotate data classes  Annotate id field  Annotate @ManyToMany, etc…  For reciprocal relationships, make sure to use mappedBy

5. Connect JPA to UI

Connect JPA to UI  Create a new JPAContainer.  Connect it to a Table, Form, etc.  Perform operations on the container (add, delete, update, etc)  Create a new JPAContainer.  Connect it to a Table, Form, etc.  Perform operations on the container (add, delete, update, etc)