SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Vaadin Data Model and
JPAContainer
YRD.DOÇ.DR. CELAL MURAT KANDEMİR
ESKİSEHİR OSMANGAZI UNIVERSITY – FACULTY OF EDUCATION
This work is licensed under a Creative Commons Attribution 4.0 International License. http://creativecommons.org/licenses/by-nc/4.0/
Three-Layer Architecture
The data binding model in Vaadin can be used to bind user interface components to a domain
layer.
Role of JPAContainer in binding Vaadin
components to a database
Vaadin JPAContainer allows connecting Vaadin user interface components directly to the
persistent model objects.
You can use the container to display data in a table, tree, any other selection component, or
edit the data in a form.
Data Model
Vaadin Data Model-Binding Components
to Data
The model allows binding user interface
components directly to the data that they display and
possibly allow to edit. There are three nested levels
of hierarchy in the data model: property, item,
and container. Using a spreadsheet application as an
analogy, these would correspond to a cell, a row, and
a table, respectively.
The Data Model is realized as a set of interfaces in
the com.vaadin.data package. The package contains
the Property, Item, and Container interfaces, along
with a number of more specialized interfaces and
classes.
Vaadin Data Model-Binding Components
to Data
The Data Model has many important and useful
features, such as support for change notification.
Especially containers have many helper interfaces,
including ones that allow indexing, ordering, sorting,
and filtering the data.
Field components provide a number of features
involving the data model, such as buffering,
validation, and lazy loading.
Properties
The Property interface is the base of the Vaadin Data Model. It provides a standardized API for
a single data value object that can be read (get) and written (set).
You can set the value of a property with setValue() and read with getValue()
Property Viewers and Editors
A property can be bound to a component
implementing the Viewer interface with
setPropertyDataSource()
You can use the same method in the Editor
interface to bind a component that allows
editing a particular property type to a
property.
Field Validation
ObjectProperty Implementation
The ObjectProperty class is a simple implementation of the Property interface that allows
storing an arbitrary Java object.
Converting Between Property Type and
Representation
Holding properties in Items
The Item interface provides access to a set of named properties.
Each property is identified by a property identifier (PID) and a reference to such a property can
be queried from an Item with getItemProperty() using the identifier.
Wrapping a Bean in a BeanItem
The BeanItem
implementation of the
Item interface is a wrapper
for Java Bean objects.
In fact, only the setters
and getters are required
while serialization and
other bean features are
not, so you can wrap
almost any POJOs with
minimal requirements.
Nested Beans
You may often have composite classes where one class "has a" another class.
Nested Beans
When shown in a Form, for example, you would
want to list the properties of the nested bean
along the properties of the composite bean.
You can do that by binding the properties of the
nested bean individually with a MethodProperty
or NestedMethodProperty.
The difference is that NestedMethodProperty
does not access the nested bean immediately but
only when accessing the property values, while
when using MethodProperty the nested bean is
accessed when creating the method property.
The difference is only significant if the nested
bean can be null or be changed later.
A Form with Nested Bean Properties
A Form with Nested Bean Properties
The item could be any item type, as described earlier.
A Form with Nested Bean Properties
Design a form for editing the data.
A Form with Nested Bean Properties
Bind the fields to the data as follows:
Collecting Items in Containers
All of the user interface components using containers also implement the relevant container
interfaces themselves, so that the access to the underlying data source is delegated through the
component.
Creating and Binding a Container
More details about Data Model
https://vaadin.com/book/-/page/datamodel.html
Vaadin JPAContainer
Three-Layer Architecture
The data binding model in Vaadin can be used to bind user interface components to a domain
layer.
Role of JPAContainer in binding Vaadin
components to a database
Vaadin JPAContainer allows connecting Vaadin user interface components directly to the
persistent model objects.
You can use the container to display data in a table, tree, any other selection component, or
edit the data in a form.
Properties
Atomic data is represented as Property objects that have a value and a type. Properties can be
bound to Field components, such as a TextField, or a table cell.
The ObjectProperty used above is just one implementation of the Property interface – in
JPAContainer we use a different property type.
Items
An Item is a collection of properties that is typically bound to a Form or a row in a Table or
some other selection component. Properties of an item are identified by a property identifier
(PID).
Containers
A Container is a collection of items, usually bound to a Table, Tree, or some other selection
component. Items in a container are identified by an item identifier (IID). Normally, all the items
in a container have the same type and the same properties.
Normal (Non-Persistent) Binding to
JavaBeans
Vaadin core library provides BeanItem implementation of the Item interface to bind bean objects. At the
Container level, Vaadin provides the BeanItemContainer and BeanContainer implementations.
They are very useful for handling transient (non-persistent) objects.
Java Persistence API
Java Persistence API (JPA) is an API for object-
relational mapping (ORM) of Java objects to a
relational database.
In JPA and entity-relationship modeling in general,
a Java class is considered an entity.
Class (or entity) instances correspond with a row in
a database table and member variables of a class
with columns.
Entities can also have relationships with other
entities.
Installing Vaadin JPAContainer
https://vaadin.com/book/-/page/jpacontainer.installation.html
https://vaadin.com/directory#!addon/vaadin-jpacontainer
JPAContainer AddressBook Demo
Next Lab
https://vaadin.com/tutorial

Contenu connexe

Tendances

Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPASubin Sugunan
 
"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил АнохинFwdays
 
Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Fwdays
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 
Complex Data Binding
Complex Data BindingComplex Data Binding
Complex Data BindingDoncho Minkov
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsosa_ora
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Trainingsourabh aggarwal
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)Markus Eisele
 
Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring DataCorneil du Plessis
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernatehr1383
 
Develop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxDevelop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxvishal choudhary
 

Tendances (20)

JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
Metaworks3
Metaworks3Metaworks3
Metaworks3
 
"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин"Android Data Binding в массы" Михаил Анохин
"Android Data Binding в массы" Михаил Анохин
 
Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"Михаил Анохин "Data binding 2.0"
Михаил Анохин "Data binding 2.0"
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
 
Complex Data Binding
Complex Data BindingComplex Data Binding
Complex Data Binding
 
JPA 2.1 performance tuning tips
JPA 2.1 performance tuning tipsJPA 2.1 performance tuning tips
JPA 2.1 performance tuning tips
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2TY.BSc.IT Java QB U2
TY.BSc.IT Java QB U2
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
Ecom lec4 fall16_jpa
Ecom lec4 fall16_jpaEcom lec4 fall16_jpa
Ecom lec4 fall16_jpa
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)
 
J2EE jsp_03
J2EE jsp_03J2EE jsp_03
J2EE jsp_03
 
Polyglot persistence with Spring Data
Polyglot persistence with Spring DataPolyglot persistence with Spring Data
Polyglot persistence with Spring Data
 
Introduction to hibernate
Introduction to hibernateIntroduction to hibernate
Introduction to hibernate
 
ButterKnife
ButterKnifeButterKnife
ButterKnife
 
Backendless apps
Backendless appsBackendless apps
Backendless apps
 
Develop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptxDevelop a native application that uses GPS location.pptx
Develop a native application that uses GPS location.pptx
 

En vedette

Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin componentsPeter Lehto
 
Vaadin 8 - Data Binding with Binder
Vaadin 8 - Data Binding with BinderVaadin 8 - Data Binding with Binder
Vaadin 8 - Data Binding with BinderPeter Lehto
 
[강의소개] 안드로이드 앱 개발 입문 캠프 4기
[강의소개] 안드로이드 앱 개발 입문 캠프 4기[강의소개] 안드로이드 앱 개발 입문 캠프 4기
[강의소개] 안드로이드 앱 개발 입문 캠프 4기FAST CAMPUS
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Peter Lehto
 
자바 8 스트림 API
자바 8 스트림 API자바 8 스트림 API
자바 8 스트림 APINAVER Corp
 
간단 Ip 필터 구현 이야기
간단 Ip 필터 구현 이야기간단 Ip 필터 구현 이야기
간단 Ip 필터 구현 이야기beom kyun choi
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교Woo Yeong Choi
 
이것이 레디스다.
이것이 레디스다.이것이 레디스다.
이것이 레디스다.Kris Jeong
 
Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략Jin wook
 
자바8 스트림 API 소개
자바8 스트림 API 소개자바8 스트림 API 소개
자바8 스트림 API 소개beom kyun choi
 
Vermont Code Camp 2014 Simple Rover with RaspberryPi
Vermont Code Camp 2014   Simple Rover with RaspberryPiVermont Code Camp 2014   Simple Rover with RaspberryPi
Vermont Code Camp 2014 Simple Rover with RaspberryPiJohn Cicilio
 
Video Techniques and Influences
Video Techniques and InfluencesVideo Techniques and Influences
Video Techniques and Influencestalitha-roberts
 
EL PUNTO, LA linea Y EL PLANO
EL PUNTO, LA linea Y EL PLANOEL PUNTO, LA linea Y EL PLANO
EL PUNTO, LA linea Y EL PLANOyulianandreahvn
 

En vedette (20)

Binding business data to vaadin components
Binding business data to vaadin componentsBinding business data to vaadin components
Binding business data to vaadin components
 
Vaadin 8 - Data Binding with Binder
Vaadin 8 - Data Binding with BinderVaadin 8 - Data Binding with Binder
Vaadin 8 - Data Binding with Binder
 
[강의소개] 안드로이드 앱 개발 입문 캠프 4기
[강의소개] 안드로이드 앱 개발 입문 캠프 4기[강의소개] 안드로이드 앱 개발 입문 캠프 4기
[강의소개] 안드로이드 앱 개발 입문 캠프 4기
 
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
Remote controlling Parrot AR Drone with Spring Boot & Vaadin (JavaCro15)
 
Java JPA
Java JPAJava JPA
Java JPA
 
자바 8 스트림 API
자바 8 스트림 API자바 8 스트림 API
자바 8 스트림 API
 
Redis edu 1
Redis edu 1Redis edu 1
Redis edu 1
 
간단 Ip 필터 구현 이야기
간단 Ip 필터 구현 이야기간단 Ip 필터 구현 이야기
간단 Ip 필터 구현 이야기
 
mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교mongodb와 mysql의 CRUD 연산의 성능 비교
mongodb와 mysql의 CRUD 연산의 성능 비교
 
이것이 레디스다.
이것이 레디스다.이것이 레디스다.
이것이 레디스다.
 
Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략Mongo DB 성능최적화 전략
Mongo DB 성능최적화 전략
 
자바8 스트림 API 소개
자바8 스트림 API 소개자바8 스트림 API 소개
자바8 스트림 API 소개
 
Vermont Code Camp 2014 Simple Rover with RaspberryPi
Vermont Code Camp 2014   Simple Rover with RaspberryPiVermont Code Camp 2014   Simple Rover with RaspberryPi
Vermont Code Camp 2014 Simple Rover with RaspberryPi
 
Bebetter powerpoint
Bebetter powerpointBebetter powerpoint
Bebetter powerpoint
 
Система работы методической службы
Система работы методической службыСистема работы методической службы
Система работы методической службы
 
Video Techniques and Influences
Video Techniques and InfluencesVideo Techniques and Influences
Video Techniques and Influences
 
Chris
ChrisChris
Chris
 
EL PUNTO, LA linea Y EL PLANO
EL PUNTO, LA linea Y EL PLANOEL PUNTO, LA linea Y EL PLANO
EL PUNTO, LA linea Y EL PLANO
 
The aztecs
The aztecsThe aztecs
The aztecs
 
лр1 (петреченко)
лр1 (петреченко)лр1 (петреченко)
лр1 (петреченко)
 

Similaire à Vaadin JPAContainer

Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkRajind Ruparathna
 
Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5phanleson
 
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Metamorphosis from Forms to Java:  A technical lead's perspective, part IIMetamorphosis from Forms to Java:  A technical lead's perspective, part II
Metamorphosis from Forms to Java: A technical lead's perspective, part IIMichael Fons
 
Dao pattern
Dao patternDao pattern
Dao patternciriako
 
Data Binding for Xamarin Forms In-Depth
Data Binding for Xamarin Forms In-DepthData Binding for Xamarin Forms In-Depth
Data Binding for Xamarin Forms In-DepthAlejandro Ruiz Varela
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beansHitesh Parmar
 
Hibernate Session 1
Hibernate Session 1Hibernate Session 1
Hibernate Session 1b_kathir
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5phanleson
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in SilverlightBoulos Dib
 
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad NicheTech Com. Solutions Pvt. Ltd.
 

Similaire à Vaadin JPAContainer (20)

Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
P20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptxP20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptx
 
Session 5 Tp5
Session 5 Tp5Session 5 Tp5
Session 5 Tp5
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Metamorphosis from Forms to Java: A technical lead's perspective, part II
Metamorphosis from Forms to Java:  A technical lead's perspective, part IIMetamorphosis from Forms to Java:  A technical lead's perspective, part II
Metamorphosis from Forms to Java: A technical lead's perspective, part II
 
Spring 2
Spring 2Spring 2
Spring 2
 
Java Beans
Java BeansJava Beans
Java Beans
 
Entity Frame Work Core.pptx
Entity Frame Work Core.pptxEntity Frame Work Core.pptx
Entity Frame Work Core.pptx
 
Dao pattern
Dao patternDao pattern
Dao pattern
 
Data Binding for Xamarin Forms In-Depth
Data Binding for Xamarin Forms In-DepthData Binding for Xamarin Forms In-Depth
Data Binding for Xamarin Forms In-Depth
 
Ado.net
Ado.netAdo.net
Ado.net
 
Ado Net
Ado NetAdo Net
Ado Net
 
Ef code first
Ef code firstEf code first
Ef code first
 
Introduction to java beans
Introduction to java beansIntroduction to java beans
Introduction to java beans
 
Hibernate Session 1
Hibernate Session 1Hibernate Session 1
Hibernate Session 1
 
Oracle application-development-framework-best-practices
Oracle application-development-framework-best-practicesOracle application-development-framework-best-practices
Oracle application-development-framework-best-practices
 
Jdbc Lecture5
Jdbc Lecture5Jdbc Lecture5
Jdbc Lecture5
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in Silverlight
 
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
Cocoa and MVC in ios, iOS Training Ahmedbad , iOS classes Ahmedabad
 

Plus de cmkandemir

Temel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım ÖrnekleriTemel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım Örneklericmkandemir
 
Yapay Zeka Nedir?
Yapay Zeka Nedir?Yapay Zeka Nedir?
Yapay Zeka Nedir?cmkandemir
 
Zekayı Anlamak
Zekayı AnlamakZekayı Anlamak
Zekayı Anlamakcmkandemir
 
PHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesiPHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesicmkandemir
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systemscmkandemir
 
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly LanguageChapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly Languagecmkandemir
 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructionscmkandemir
 
Chapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 InstructionsChapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 Instructionscmkandemir
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2cmkandemir
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1cmkandemir
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Javacmkandemir
 
impress.js Framework
impress.js Frameworkimpress.js Framework
impress.js Frameworkcmkandemir
 
openCV and Java - Face Detection
openCV and Java - Face DetectionopenCV and Java - Face Detection
openCV and Java - Face Detectioncmkandemir
 
PHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlerPHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlercmkandemir
 
CSS Uygulamaları 1
CSS Uygulamaları 1CSS Uygulamaları 1
CSS Uygulamaları 1cmkandemir
 
CSS - Sunum Bileşenleri
CSS - Sunum BileşenleriCSS - Sunum Bileşenleri
CSS - Sunum Bileşenlericmkandemir
 
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, FonksiyonlarKod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, Fonksiyonlarcmkandemir
 
Web Sitesi Geliştirme Adımları
Web Sitesi Geliştirme AdımlarıWeb Sitesi Geliştirme Adımları
Web Sitesi Geliştirme Adımlarıcmkandemir
 
CSS - Genel Bakış
CSS - Genel BakışCSS - Genel Bakış
CSS - Genel Bakışcmkandemir
 
Threads and Game Programming In Java
Threads and Game Programming In JavaThreads and Game Programming In Java
Threads and Game Programming In Javacmkandemir
 

Plus de cmkandemir (20)

Temel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım ÖrnekleriTemel HTML Etiketleri ve Kullanım Örnekleri
Temel HTML Etiketleri ve Kullanım Örnekleri
 
Yapay Zeka Nedir?
Yapay Zeka Nedir?Yapay Zeka Nedir?
Yapay Zeka Nedir?
 
Zekayı Anlamak
Zekayı AnlamakZekayı Anlamak
Zekayı Anlamak
 
PHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesiPHP - Kullanıcı Girişlerinin İşlenmesi
PHP - Kullanıcı Girişlerinin İşlenmesi
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
 
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly LanguageChapter 1-Microprocessors, Microcomputers, and Assembly Language
Chapter 1-Microprocessors, Microcomputers, and Assembly Language
 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructions
 
Chapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 InstructionsChapter 6 - Introduction to 8085 Instructions
Chapter 6 - Introduction to 8085 Instructions
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 2
 
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
Canvas Öğrenme Yönetim Sistemi Kullanım Kılavuzu Bölüm 1
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Java
 
impress.js Framework
impress.js Frameworkimpress.js Framework
impress.js Framework
 
openCV and Java - Face Detection
openCV and Java - Face DetectionopenCV and Java - Face Detection
openCV and Java - Face Detection
 
PHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemlerPHP ve MySQL Bağlantısı - Temel İşlemler
PHP ve MySQL Bağlantısı - Temel İşlemler
 
CSS Uygulamaları 1
CSS Uygulamaları 1CSS Uygulamaları 1
CSS Uygulamaları 1
 
CSS - Sunum Bileşenleri
CSS - Sunum BileşenleriCSS - Sunum Bileşenleri
CSS - Sunum Bileşenleri
 
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, FonksiyonlarKod Akış Kontrolü - Döngüler, Fonksiyonlar
Kod Akış Kontrolü - Döngüler, Fonksiyonlar
 
Web Sitesi Geliştirme Adımları
Web Sitesi Geliştirme AdımlarıWeb Sitesi Geliştirme Adımları
Web Sitesi Geliştirme Adımları
 
CSS - Genel Bakış
CSS - Genel BakışCSS - Genel Bakış
CSS - Genel Bakış
 
Threads and Game Programming In Java
Threads and Game Programming In JavaThreads and Game Programming In Java
Threads and Game Programming In Java
 

Dernier

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 

Dernier (20)

Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Vaadin JPAContainer

  • 1. Vaadin Data Model and JPAContainer YRD.DOÇ.DR. CELAL MURAT KANDEMİR ESKİSEHİR OSMANGAZI UNIVERSITY – FACULTY OF EDUCATION This work is licensed under a Creative Commons Attribution 4.0 International License. http://creativecommons.org/licenses/by-nc/4.0/
  • 2. Three-Layer Architecture The data binding model in Vaadin can be used to bind user interface components to a domain layer.
  • 3. Role of JPAContainer in binding Vaadin components to a database Vaadin JPAContainer allows connecting Vaadin user interface components directly to the persistent model objects. You can use the container to display data in a table, tree, any other selection component, or edit the data in a form.
  • 5. Vaadin Data Model-Binding Components to Data The model allows binding user interface components directly to the data that they display and possibly allow to edit. There are three nested levels of hierarchy in the data model: property, item, and container. Using a spreadsheet application as an analogy, these would correspond to a cell, a row, and a table, respectively. The Data Model is realized as a set of interfaces in the com.vaadin.data package. The package contains the Property, Item, and Container interfaces, along with a number of more specialized interfaces and classes.
  • 6. Vaadin Data Model-Binding Components to Data The Data Model has many important and useful features, such as support for change notification. Especially containers have many helper interfaces, including ones that allow indexing, ordering, sorting, and filtering the data. Field components provide a number of features involving the data model, such as buffering, validation, and lazy loading.
  • 7. Properties The Property interface is the base of the Vaadin Data Model. It provides a standardized API for a single data value object that can be read (get) and written (set). You can set the value of a property with setValue() and read with getValue()
  • 8. Property Viewers and Editors A property can be bound to a component implementing the Viewer interface with setPropertyDataSource() You can use the same method in the Editor interface to bind a component that allows editing a particular property type to a property.
  • 10. ObjectProperty Implementation The ObjectProperty class is a simple implementation of the Property interface that allows storing an arbitrary Java object.
  • 11. Converting Between Property Type and Representation
  • 12. Holding properties in Items The Item interface provides access to a set of named properties. Each property is identified by a property identifier (PID) and a reference to such a property can be queried from an Item with getItemProperty() using the identifier.
  • 13. Wrapping a Bean in a BeanItem The BeanItem implementation of the Item interface is a wrapper for Java Bean objects. In fact, only the setters and getters are required while serialization and other bean features are not, so you can wrap almost any POJOs with minimal requirements.
  • 14. Nested Beans You may often have composite classes where one class "has a" another class.
  • 15. Nested Beans When shown in a Form, for example, you would want to list the properties of the nested bean along the properties of the composite bean. You can do that by binding the properties of the nested bean individually with a MethodProperty or NestedMethodProperty. The difference is that NestedMethodProperty does not access the nested bean immediately but only when accessing the property values, while when using MethodProperty the nested bean is accessed when creating the method property. The difference is only significant if the nested bean can be null or be changed later.
  • 16. A Form with Nested Bean Properties
  • 17. A Form with Nested Bean Properties The item could be any item type, as described earlier.
  • 18. A Form with Nested Bean Properties Design a form for editing the data.
  • 19. A Form with Nested Bean Properties Bind the fields to the data as follows:
  • 20. Collecting Items in Containers All of the user interface components using containers also implement the relevant container interfaces themselves, so that the access to the underlying data source is delegated through the component.
  • 21. Creating and Binding a Container
  • 22. More details about Data Model https://vaadin.com/book/-/page/datamodel.html
  • 24. Three-Layer Architecture The data binding model in Vaadin can be used to bind user interface components to a domain layer.
  • 25. Role of JPAContainer in binding Vaadin components to a database Vaadin JPAContainer allows connecting Vaadin user interface components directly to the persistent model objects. You can use the container to display data in a table, tree, any other selection component, or edit the data in a form.
  • 26. Properties Atomic data is represented as Property objects that have a value and a type. Properties can be bound to Field components, such as a TextField, or a table cell. The ObjectProperty used above is just one implementation of the Property interface – in JPAContainer we use a different property type.
  • 27. Items An Item is a collection of properties that is typically bound to a Form or a row in a Table or some other selection component. Properties of an item are identified by a property identifier (PID).
  • 28. Containers A Container is a collection of items, usually bound to a Table, Tree, or some other selection component. Items in a container are identified by an item identifier (IID). Normally, all the items in a container have the same type and the same properties.
  • 29. Normal (Non-Persistent) Binding to JavaBeans Vaadin core library provides BeanItem implementation of the Item interface to bind bean objects. At the Container level, Vaadin provides the BeanItemContainer and BeanContainer implementations. They are very useful for handling transient (non-persistent) objects.
  • 30. Java Persistence API Java Persistence API (JPA) is an API for object- relational mapping (ORM) of Java objects to a relational database. In JPA and entity-relationship modeling in general, a Java class is considered an entity. Class (or entity) instances correspond with a row in a database table and member variables of a class with columns. Entities can also have relationships with other entities.
  • 32. JPAContainer AddressBook Demo Next Lab https://vaadin.com/tutorial