SlideShare a Scribd company logo
1 of 45
Download to read offline
Hibernate Persistence Framework
and
Object Relational Mapping
Who is Kenan Sevindik?
● Over 15 years of
experience in enterprise
software development
● Involved in development
of architectures of several
enterprise projects
● Has extensive knowledge
and experience about
enterprise Java
technologies, such as
Spring, Spring Security,
Hibernate, Vaadin
Who is Kenan Sevindik?
● Co-author of Beginning
Spring Book
● Founded Harezmi IT
Solutions in 2011
● What Harezmi offers?
– Enterprise software
development services
– Mentoring and consultancy
services
– Organizing trainings about
enterprise Java technologies
Introduction To ORM
Uygulama
ORM
(Hibernate)
DB
 ORM solutions help us
to handle persistent
data on Java side
 They lay between
service and database
layers
 Their aim is to let
developers focus more
on business logic
 Persistence operations
are performed over
domain model as
much as possible
Domain Model / Object Model
E-R Model / Data Model
Advantages of ORM
● You model entities (domain objects) based on
real business concepts rather than based on your
DB structure
● Reduces considerable amount of code to
perform repetitive persistence operations (CRUD)
over entities
● Provides rich query capabilities based on object
oriented concepts rather than relational algebra
● Encapsulates vendor specific SQL
Paradigm Shift
Object Oriented World ≠ Relational World
Paradigm Shift
● Granularity problem
– It is not always the case that each table matches
with one and only one class or vice versa
● Problem with directional relationships
– Domain model contains direction information
between entity relations
– Relational model has no direction information on the
other hand
● Identity problem
– Database identity, object identity and object equality
are just three differenent concepts and you should
be aware of them
Paradigm Shift
● Subclass problem and polymorphic queries
– A class hierarchy can be mapped into several
different table combinations
– Any ORM solution should allow developers to query
objects over their super classes and interfaces
● Problem with object network traversal
– Domain model is suitable to be traversed one by
one as information is needed in application
– Relational model, on the other hand, is more
suitable to fetch necessary data once in the
beginning
What is JPA? and Relationship
between Hibernate & JPA
Service Layer
DAO Layer
JPA
Hibernate
DB
Hibernate
World
JPA
World
JPA is ORM specification of EJB3
Hibernate on the other hand is one of those JPA
implementations. Others are;
EclipseLink, OpenJPA, DataNucleus
Benefits of JPA
● Standardization of discovery of metadata
eases configuration steps
● Configuration of ORM part becomes
standard in any enterprise Java
application
● Persistence operations are performed
over a standard data access API
Compartments of an
ORM Solution
● Any ORM solution consists of four fundamental
parts
– Metadata definition capability
– API for CRUD operations
– Persistence Context to track changes made
on domain objects, to manage lazy
associations
– Query/Criteria API for search requirements
O/R Mapping Metadata
● Metadata means data about data
● ORM solution makes use of this metadata to deal
with domain objects and relational data
● It helps ORM to transform data/state from one
representation into another
METADATA
O/R Mapping Metadata
● ORM solution maps between following
structures
– Classes & tables
– Properties & columns
– Associations & foreign keys
– Java types & SQL types
Metadata Example@Entity
@Table(name="T_PET")
public class Pet {
@Id
private Long id;
@Column(name="PET_NAME")
private String name;
public void setId(Long id) {
this.id = id;
}
public Long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
Metadata Example (XML)
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.javaegitimleri.petclinic.model.Pet" table="PETS">
<id name="id" type="long">
<column name="ID" />
<generator class="assigned" />
</id>
<property name="name" type="string">
<column name="NAME" />
</property>
</class>
</hibernate-mapping>
Entity Associations
● Associations between entities can be examined
from several different perspectives
– According to multiplicity: single sided (M:1,1:1), many
sided (1:M,M:N)
– According to aggregate type used in many sided
associations (list, set, map, bag)
– According to direction of the association (unidirectional,
bidirectional)
– According to using a separate join table or join column to
keep association information
M:1
@Entity
public class Pet {
@ManyToOne
@JoinColumn(name = "TYPE_ID")
private PetType petType;
}
@Entity
public class PetType {
}
T_PET_TYPE
ID
1
T_PET
ID TYPE_ID
101 1
1:M – Unidirectional Set
@Entity
public class Pet {
@OneToMany
@JoinColumn(name = "PET_ID")
private Set<Visit> visits =
new HashSet <Visit>();
}
@Entity
public class Visit {
}
T_PET
ID
1
T_VISIT
ID PET_ID
55 1
1:M – Unidirectional List
@Entity
public class Owner {
@OneToMany
@JoinColumn(name = "OWNER_ID")
@OrderColumn(name = "PET_POSITION")
private List<Pet> pets = new ArrayList<Pet>();
}
@Entity
public class Pet {
}
ID OWNER_ID PET_POSITION NAME
1 1 0 Foo
2 1 1 Bar
3 2 0 Bat
4 1 2 Baz
PET TABLOSU
1:M – Bidirectional Set
public class Owner {
@OneToMany(mappedBy = "owner")
private Set<Pet> pets = new HashSet<Pet>();
}
public class Pet {
@ManyToOne
@JoinColumn(name = "OWNER_ID")
private Owner owner;
}
1:M & Using Join Table
@Entity
public class Owner {
@OneToMany
@JoinTable(
name = "T_OWNER_PET",
joinColumns = {@JoinColumn(name = "OWNER_ID")},
inverseJoinColumns = {@JoinColumn(name = "PET_ID")})
private Set<Pet> pets = new HashSet<Pet>();
}
@Entity
public class Pet {
}
T_OWNER
ID
T_PET
ID
T_OWNER_PET
OWNER_ID , PET_ID
Unidirectional N:M
@Entity
public class Vet {
@ManyToMany
@JoinTable(name = "T_VET_SPECIALTY",
JoinColumns = {@JoinColumn(name="VET_ID")},
inverseJoinColumns = {@JoinColumn(name="SPECIALTY_ID")})
private Set<Specialty> specialties=new HashSet<Specialty>();
}
@Entity
public class Specialty {
}
Inheritance
● Using single table for complete class hierarchy
● Using separate tables for each distinct class
(abstract or concrete) in the hierarchy
● Using separate tables only for concrete
classes in the hierarchy
Single Table
T_PERSON
ID
FIRST_NAME
LAST_NAME
EMAIL
GRADUATION_YEAR
PERSON_TYPE
Single Table
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "PERSON_TYPE",
discriminatorType = DiscriminatorType.STRING)
public abstract class Person {
@Id @GeneratedValue
private Long id = null;
//…
}
@Entity
@DiscriminatorValue("O")
public class Owner extends Person {
//…
}
@Entity
@DiscriminatorValue("V")
public class Vet extends Person {
//…
}
Separate Tables for Each
Distinct Class
T_OWNER
ID
EMAIL
T_PERSON
ID
FIRST_NAME
LAST_NAME
T_VET
ID
GRADUATION_YEAR
Separate Tables for Each
Distinct Class
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Person {
@Id @GeneratedValue
private Long id = null;
//…
}
@Entity
public class Owner extends Person {
//…
}
@Entity
@PrimaryKeyJoinColumn(name = "VET_ID")
public class Vet extends Person {
//…
}
Separate Table Only For
Concrete Classes
T_OWNER
ID
FIRST_NAME
LAST_NAME
EMAIL
T_VET
ID
FIRST_NAME
LAST_NAME
GRADUATION_YEAR
@MappedSuperclass
public abstract class Person {
@Id @GeneratedValue
@Column(name = "ID")
private Long id = null;
//…
}
@Entity
@AttributeOverride(name = "id", column = @Column(name = "VET_ID"))
public class Vet extends Person {
//…
}
Separate Table Only For
Concrete Classes
@Entity
public class Vet extends Person {
//…
}
Polymorphic Associations
for( Person person : petClinic.getPersons() ) {
//Person spesifik metotlar çağrılabilir...
}
T_PETCLINIC
ID
T_OWNER
ID
FIRST_NAME
LAST_NAME
EMAIL
CLINIC_ID
T_VET
ID
FIRST_NAME
LAST_NAME
GRADUATION_YEAR
CLINIC_ID
FK FK
Polymorphic Associations &
Only For Concrete Classes Method
Polymorphic Associations &
Only For Concrete Classes Method
T_PETCLINIC
ID
OWNER_ID
VET_ID
T_OWNER
ID
FIRST_NAME
LAST_NAME
EMAIL
T_VET
ID
FIRST_NAME
LAST_NAME
GRADUATION_YEAR
FK FK
Persistent Domain Objects
& State Transitions
Session session = null;
Transaction transaction = null;
try {
session = sessionFactory.openSession();
tx = session.beginTransaction();
Pet kedi = new Pet();
kedi.setName("boncuk");
session.save(kedi);
transaction.commit();
} catch (RuntimeException ex) {
transaction.rollback();
} finally {
session.close();
}
Persistence API Example
Persistence operation must always
execute within an active TX block
Object Query Languages
● Any ORM tool provides a mechanism to
perform data fetching via a query mechanism
● That query mechanism is based on object
graph and navigation between object
relationships
● JPA and Hibernate provide their own object
query languages and programmatic query
generation mechanisms as well
Sample Object Queries
● from Pet
● from Pet as p
● from Pet p
● from Person
● from Owner
● from java.lang.Object
● from java.io.Serializable nesneleri döner
● from Owner o where o.email = 'foo@bar.org'
Sample Object Queries
● from Owner o where p.email in ('foo@bar', 'bar@foo')
● from Owner o where p.email is null
● from Owner o where p.email is not null
● from Person p where p.firstName like 'G%'
● from Person p where p.firstName not like '%Foo B%'
● from Person p where p.firstName not like '%Foo%'
escape=''
● from Person p order by p.firstName
● from Person p order by p.firstName desc
● from Person p order by p.lastName asc, p.firstName desc
Sample Object Queries
● from Person p where p.firstName like 'G%' and p.lastName
like 'K%'
● from Owner o where (o.firstName like 'G%' and o.lastName
like 'K%') or o.email in ('foo@bar', 'bar@foo')
● from Owner o where lower(o.email) = 'foo@hibernate.org'
● from Person p where concat(p.firstName, p.lastName) like 'G
% K%'
● from Pet p where p.visits is not empty
● from Pet p where size(p.visits) > 0
● from Pet p, Owner o where p member of o.pets and p.name
like '%Kitty%'
Sample Object Queries
● from Item i where i.price between 1 and 100
● from Item i where i.price > 100
● from Item i where ( i.price / 0.71 ) - 100.0 > 0.0
Executing Queries
Query query = session.createQuery("from Pet p
order by p.name desc");
List pets = query.list();
Pet pet = (Pet) session.createQuery("from Pet p where
p.id = 1").uniqueResult();
Conclusion
● ORM is not a one size fits all solution
● It is very useful for some sort of
applications, but not for others
● It helps you to reduce persistence related
code you write
● It may simplify queries to fetch data
Conclusion
● “We can forget about/ignore SQL, because
we are using Hibernate/JPA” thinking is a big
mistake
● It is very easy to create performance
bottlenecks in your applications while using
ORM
● It has a steep learning curve, so be prepared
before you start using it in your next big project!
Choice is Yours!
Questions & Answers
Contact
● Harezmi Bilişim Çözümleri A.Ş.
● http://www.harezmi.com.tr
● info@harezmi.com.tr

More Related Content

What's hot

Report on Work of Joint DCMI/IEEE LTSC Task Force
Report on Work of Joint DCMI/IEEE LTSC Task ForceReport on Work of Joint DCMI/IEEE LTSC Task Force
Report on Work of Joint DCMI/IEEE LTSC Task ForceEduserv Foundation
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++rprajat007
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Sakthi Durai
 
Semantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesSemantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesDeniz Kılınç
 
Programming in c++
Programming in c++Programming in c++
Programming in c++Baljit Saini
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Svetlin Nakov
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistencePrem Lamsal
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteTushar B Kute
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate FrameworkRaveendra R
 
OOP with Java - Continued
OOP with Java - Continued OOP with Java - Continued
OOP with Java - Continued Hitesh-Java
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2Raghu nath
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programmingPraveen Chowdary
 

What's hot (20)

Report on Work of Joint DCMI/IEEE LTSC Task Force
Report on Work of Joint DCMI/IEEE LTSC Task ForceReport on Work of Joint DCMI/IEEE LTSC Task Force
Report on Work of Joint DCMI/IEEE LTSC Task Force
 
Classes and objects in c++
Classes and objects in c++Classes and objects in c++
Classes and objects in c++
 
C++ classes
C++ classesC++ classes
C++ classes
 
Class or Object
Class or ObjectClass or Object
Class or Object
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
4 Classes & Objects
4 Classes & Objects4 Classes & Objects
4 Classes & Objects
 
Generics
GenericsGenerics
Generics
 
Class and object in C++
Class and object in C++Class and object in C++
Class and object in C++
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Semantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesSemantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sources
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015Entity Framework: Nakov @ BFU Hackhaton 2015
Entity Framework: Nakov @ BFU Hackhaton 2015
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Chapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B KuteChapter 01 Introduction to Java by Tushar B Kute
Chapter 01 Introduction to Java by Tushar B Kute
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Introduction to Hibernate Framework
Introduction to Hibernate FrameworkIntroduction to Hibernate Framework
Introduction to Hibernate Framework
 
OOP with Java - Continued
OOP with Java - Continued OOP with Java - Continued
OOP with Java - Continued
 
Concept of Object Oriented Programming
Concept of Object Oriented Programming Concept of Object Oriented Programming
Concept of Object Oriented Programming
 
Basics of java 2
Basics of java 2Basics of java 2
Basics of java 2
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 

Viewers also liked

Contemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With EnterpriseContemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With EnterpriseKenan Sevindik
 
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...Developing Reusable Software Components Using MVP, Observer and Mediator Patt...
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...Kenan Sevindik
 
Hibernate Mapping on the Fly
Hibernate Mapping on the FlyHibernate Mapping on the Fly
Hibernate Mapping on the FlyEdureka!
 
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)Nicolas Defay
 
Java persistence api
Java persistence api Java persistence api
Java persistence api Luis Goldster
 
Spring 4. Part 1 - IoC, AOP
Spring 4. Part 1 - IoC, AOPSpring 4. Part 1 - IoC, AOP
Spring 4. Part 1 - IoC, AOPNakraynikov Oleg
 
Cassandra for mission critical data
Cassandra for mission critical dataCassandra for mission critical data
Cassandra for mission critical dataOleksandr Semenov
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置Guo Albert
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Sam Brannen
 
Spring.Boot up your development
Spring.Boot up your developmentSpring.Boot up your development
Spring.Boot up your developmentStrannik_2013
 
Google Web Toolkit: a case study
Google Web Toolkit: a case studyGoogle Web Toolkit: a case study
Google Web Toolkit: a case studyBryan Basham
 

Viewers also liked (20)

Contemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With EnterpriseContemporary Software Engineering Practices Together With Enterprise
Contemporary Software Engineering Practices Together With Enterprise
 
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...Developing Reusable Software Components Using MVP, Observer and Mediator Patt...
Developing Reusable Software Components Using MVP, Observer and Mediator Patt...
 
Hibernate Mapping on the Fly
Hibernate Mapping on the FlyHibernate Mapping on the Fly
Hibernate Mapping on the Fly
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)
Optimiser son environnement de développement PHP (Tuto NetBeans v4.4)
 
Java persistence api
Java persistence api Java persistence api
Java persistence api
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Spring 4. Part 1 - IoC, AOP
Spring 4. Part 1 - IoC, AOPSpring 4. Part 1 - IoC, AOP
Spring 4. Part 1 - IoC, AOP
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
Spring Boot Update
Spring Boot UpdateSpring Boot Update
Spring Boot Update
 
Cassandra for mission critical data
Cassandra for mission critical dataCassandra for mission critical data
Cassandra for mission critical data
 
Java persistence api 2.1
Java persistence api 2.1Java persistence api 2.1
Java persistence api 2.1
 
JPA For Beginner's
JPA For Beginner'sJPA For Beginner's
JPA For Beginner's
 
Second Level Cache in JPA Explained
Second Level Cache in JPA ExplainedSecond Level Cache in JPA Explained
Second Level Cache in JPA Explained
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置
 
Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2Get the Most out of Testing with Spring 4.2
Get the Most out of Testing with Spring 4.2
 
Spring Data Jpa
Spring Data JpaSpring Data Jpa
Spring Data Jpa
 
JPA - Beyond copy-paste
JPA - Beyond copy-pasteJPA - Beyond copy-paste
JPA - Beyond copy-paste
 
Spring.Boot up your development
Spring.Boot up your developmentSpring.Boot up your development
Spring.Boot up your development
 
Google Web Toolkit: a case study
Google Web Toolkit: a case studyGoogle Web Toolkit: a case study
Google Web Toolkit: a case study
 

Similar to 20160523 hibernate persistence_framework_and_orm

Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreIMC Institute
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Pinaki Poddar
 
SPCA2013 - SharePoint Nightmares - Coding Patterns and Practices
SPCA2013 - SharePoint Nightmares - Coding Patterns and PracticesSPCA2013 - SharePoint Nightmares - Coding Patterns and Practices
SPCA2013 - SharePoint Nightmares - Coding Patterns and PracticesNCCOMMS
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real worldAtul Chhoda
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real worldAtul Chhoda
 
PHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityPHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityGiorgio Sironi
 
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemasDC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemasMikael Nilsson
 
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...Miguel Gallardo
 
Wcf data services
Wcf data servicesWcf data services
Wcf data servicesEyal Vardi
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And TricksJulie Lerman
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPASubin Sugunan
 

Similar to 20160523 hibernate persistence_framework_and_orm (20)

Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
 
Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
ORM JPA
ORM JPAORM JPA
ORM JPA
 
.Net template solution architecture
.Net template solution architecture.Net template solution architecture
.Net template solution architecture
 
Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)Slice for Distributed Persistence (JavaOne 2010)
Slice for Distributed Persistence (JavaOne 2010)
 
L04 base patterns
L04 base patternsL04 base patterns
L04 base patterns
 
SPCA2013 - SharePoint Nightmares - Coding Patterns and Practices
SPCA2013 - SharePoint Nightmares - Coding Patterns and PracticesSPCA2013 - SharePoint Nightmares - Coding Patterns and Practices
SPCA2013 - SharePoint Nightmares - Coding Patterns and Practices
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
Spstc2011 managed metadata real world
Spstc2011 managed metadata real worldSpstc2011 managed metadata real world
Spstc2011 managed metadata real world
 
JavaEE Spring Seam
JavaEE Spring SeamJavaEE Spring Seam
JavaEE Spring Seam
 
PHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testabilityPHP Barcelona 2010 - Architecture and testability
PHP Barcelona 2010 - Architecture and testability
 
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemasDC-2008 Tutorial 3 - Dublin Core and other metadata schemas
DC-2008 Tutorial 3 - Dublin Core and other metadata schemas
 
Tibco business works
Tibco business worksTibco business works
Tibco business works
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Struts2
Struts2Struts2
Struts2
 
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
Code decoupling from Symfony (and others frameworks) - PHP Conference Brasil ...
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
Lerman Vvs14 Ef Tips And Tricks
Lerman Vvs14  Ef Tips And TricksLerman Vvs14  Ef Tips And Tricks
Lerman Vvs14 Ef Tips And Tricks
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
Core java
Core javaCore java
Core java
 

Recently uploaded

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 

Recently uploaded (20)

Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 

20160523 hibernate persistence_framework_and_orm

  • 2. Who is Kenan Sevindik? ● Over 15 years of experience in enterprise software development ● Involved in development of architectures of several enterprise projects ● Has extensive knowledge and experience about enterprise Java technologies, such as Spring, Spring Security, Hibernate, Vaadin
  • 3. Who is Kenan Sevindik? ● Co-author of Beginning Spring Book ● Founded Harezmi IT Solutions in 2011 ● What Harezmi offers? – Enterprise software development services – Mentoring and consultancy services – Organizing trainings about enterprise Java technologies
  • 4. Introduction To ORM Uygulama ORM (Hibernate) DB  ORM solutions help us to handle persistent data on Java side  They lay between service and database layers  Their aim is to let developers focus more on business logic  Persistence operations are performed over domain model as much as possible Domain Model / Object Model E-R Model / Data Model
  • 5. Advantages of ORM ● You model entities (domain objects) based on real business concepts rather than based on your DB structure ● Reduces considerable amount of code to perform repetitive persistence operations (CRUD) over entities ● Provides rich query capabilities based on object oriented concepts rather than relational algebra ● Encapsulates vendor specific SQL
  • 6. Paradigm Shift Object Oriented World ≠ Relational World
  • 7. Paradigm Shift ● Granularity problem – It is not always the case that each table matches with one and only one class or vice versa ● Problem with directional relationships – Domain model contains direction information between entity relations – Relational model has no direction information on the other hand ● Identity problem – Database identity, object identity and object equality are just three differenent concepts and you should be aware of them
  • 8. Paradigm Shift ● Subclass problem and polymorphic queries – A class hierarchy can be mapped into several different table combinations – Any ORM solution should allow developers to query objects over their super classes and interfaces ● Problem with object network traversal – Domain model is suitable to be traversed one by one as information is needed in application – Relational model, on the other hand, is more suitable to fetch necessary data once in the beginning
  • 9. What is JPA? and Relationship between Hibernate & JPA Service Layer DAO Layer JPA Hibernate DB Hibernate World JPA World JPA is ORM specification of EJB3 Hibernate on the other hand is one of those JPA implementations. Others are; EclipseLink, OpenJPA, DataNucleus
  • 10. Benefits of JPA ● Standardization of discovery of metadata eases configuration steps ● Configuration of ORM part becomes standard in any enterprise Java application ● Persistence operations are performed over a standard data access API
  • 11. Compartments of an ORM Solution ● Any ORM solution consists of four fundamental parts – Metadata definition capability – API for CRUD operations – Persistence Context to track changes made on domain objects, to manage lazy associations – Query/Criteria API for search requirements
  • 12. O/R Mapping Metadata ● Metadata means data about data ● ORM solution makes use of this metadata to deal with domain objects and relational data ● It helps ORM to transform data/state from one representation into another METADATA
  • 13. O/R Mapping Metadata ● ORM solution maps between following structures – Classes & tables – Properties & columns – Associations & foreign keys – Java types & SQL types
  • 14. Metadata Example@Entity @Table(name="T_PET") public class Pet { @Id private Long id; @Column(name="PET_NAME") private String name; public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setName(String name) { this.name = name; } public String getName() { return name; } }
  • 15. Metadata Example (XML) <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.javaegitimleri.petclinic.model.Pet" table="PETS"> <id name="id" type="long"> <column name="ID" /> <generator class="assigned" /> </id> <property name="name" type="string"> <column name="NAME" /> </property> </class> </hibernate-mapping>
  • 16. Entity Associations ● Associations between entities can be examined from several different perspectives – According to multiplicity: single sided (M:1,1:1), many sided (1:M,M:N) – According to aggregate type used in many sided associations (list, set, map, bag) – According to direction of the association (unidirectional, bidirectional) – According to using a separate join table or join column to keep association information
  • 17. M:1 @Entity public class Pet { @ManyToOne @JoinColumn(name = "TYPE_ID") private PetType petType; } @Entity public class PetType { } T_PET_TYPE ID 1 T_PET ID TYPE_ID 101 1
  • 18. 1:M – Unidirectional Set @Entity public class Pet { @OneToMany @JoinColumn(name = "PET_ID") private Set<Visit> visits = new HashSet <Visit>(); } @Entity public class Visit { } T_PET ID 1 T_VISIT ID PET_ID 55 1
  • 19. 1:M – Unidirectional List @Entity public class Owner { @OneToMany @JoinColumn(name = "OWNER_ID") @OrderColumn(name = "PET_POSITION") private List<Pet> pets = new ArrayList<Pet>(); } @Entity public class Pet { } ID OWNER_ID PET_POSITION NAME 1 1 0 Foo 2 1 1 Bar 3 2 0 Bat 4 1 2 Baz PET TABLOSU
  • 20. 1:M – Bidirectional Set public class Owner { @OneToMany(mappedBy = "owner") private Set<Pet> pets = new HashSet<Pet>(); } public class Pet { @ManyToOne @JoinColumn(name = "OWNER_ID") private Owner owner; }
  • 21. 1:M & Using Join Table @Entity public class Owner { @OneToMany @JoinTable( name = "T_OWNER_PET", joinColumns = {@JoinColumn(name = "OWNER_ID")}, inverseJoinColumns = {@JoinColumn(name = "PET_ID")}) private Set<Pet> pets = new HashSet<Pet>(); } @Entity public class Pet { } T_OWNER ID T_PET ID T_OWNER_PET OWNER_ID , PET_ID
  • 22. Unidirectional N:M @Entity public class Vet { @ManyToMany @JoinTable(name = "T_VET_SPECIALTY", JoinColumns = {@JoinColumn(name="VET_ID")}, inverseJoinColumns = {@JoinColumn(name="SPECIALTY_ID")}) private Set<Specialty> specialties=new HashSet<Specialty>(); } @Entity public class Specialty { }
  • 23. Inheritance ● Using single table for complete class hierarchy ● Using separate tables for each distinct class (abstract or concrete) in the hierarchy ● Using separate tables only for concrete classes in the hierarchy
  • 25. Single Table @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "PERSON_TYPE", discriminatorType = DiscriminatorType.STRING) public abstract class Person { @Id @GeneratedValue private Long id = null; //… } @Entity @DiscriminatorValue("O") public class Owner extends Person { //… } @Entity @DiscriminatorValue("V") public class Vet extends Person { //… }
  • 26. Separate Tables for Each Distinct Class T_OWNER ID EMAIL T_PERSON ID FIRST_NAME LAST_NAME T_VET ID GRADUATION_YEAR
  • 27. Separate Tables for Each Distinct Class @Entity @Inheritance(strategy = InheritanceType.JOINED) public abstract class Person { @Id @GeneratedValue private Long id = null; //… } @Entity public class Owner extends Person { //… } @Entity @PrimaryKeyJoinColumn(name = "VET_ID") public class Vet extends Person { //… }
  • 28. Separate Table Only For Concrete Classes T_OWNER ID FIRST_NAME LAST_NAME EMAIL T_VET ID FIRST_NAME LAST_NAME GRADUATION_YEAR
  • 29. @MappedSuperclass public abstract class Person { @Id @GeneratedValue @Column(name = "ID") private Long id = null; //… } @Entity @AttributeOverride(name = "id", column = @Column(name = "VET_ID")) public class Vet extends Person { //… } Separate Table Only For Concrete Classes @Entity public class Vet extends Person { //… }
  • 30. Polymorphic Associations for( Person person : petClinic.getPersons() ) { //Person spesifik metotlar çağrılabilir... }
  • 32. Polymorphic Associations & Only For Concrete Classes Method T_PETCLINIC ID OWNER_ID VET_ID T_OWNER ID FIRST_NAME LAST_NAME EMAIL T_VET ID FIRST_NAME LAST_NAME GRADUATION_YEAR FK FK
  • 33. Persistent Domain Objects & State Transitions
  • 34. Session session = null; Transaction transaction = null; try { session = sessionFactory.openSession(); tx = session.beginTransaction(); Pet kedi = new Pet(); kedi.setName("boncuk"); session.save(kedi); transaction.commit(); } catch (RuntimeException ex) { transaction.rollback(); } finally { session.close(); } Persistence API Example Persistence operation must always execute within an active TX block
  • 35. Object Query Languages ● Any ORM tool provides a mechanism to perform data fetching via a query mechanism ● That query mechanism is based on object graph and navigation between object relationships ● JPA and Hibernate provide their own object query languages and programmatic query generation mechanisms as well
  • 36. Sample Object Queries ● from Pet ● from Pet as p ● from Pet p ● from Person ● from Owner ● from java.lang.Object ● from java.io.Serializable nesneleri döner ● from Owner o where o.email = 'foo@bar.org'
  • 37. Sample Object Queries ● from Owner o where p.email in ('foo@bar', 'bar@foo') ● from Owner o where p.email is null ● from Owner o where p.email is not null ● from Person p where p.firstName like 'G%' ● from Person p where p.firstName not like '%Foo B%' ● from Person p where p.firstName not like '%Foo%' escape='' ● from Person p order by p.firstName ● from Person p order by p.firstName desc ● from Person p order by p.lastName asc, p.firstName desc
  • 38. Sample Object Queries ● from Person p where p.firstName like 'G%' and p.lastName like 'K%' ● from Owner o where (o.firstName like 'G%' and o.lastName like 'K%') or o.email in ('foo@bar', 'bar@foo') ● from Owner o where lower(o.email) = 'foo@hibernate.org' ● from Person p where concat(p.firstName, p.lastName) like 'G % K%' ● from Pet p where p.visits is not empty ● from Pet p where size(p.visits) > 0 ● from Pet p, Owner o where p member of o.pets and p.name like '%Kitty%'
  • 39. Sample Object Queries ● from Item i where i.price between 1 and 100 ● from Item i where i.price > 100 ● from Item i where ( i.price / 0.71 ) - 100.0 > 0.0
  • 40. Executing Queries Query query = session.createQuery("from Pet p order by p.name desc"); List pets = query.list(); Pet pet = (Pet) session.createQuery("from Pet p where p.id = 1").uniqueResult();
  • 41. Conclusion ● ORM is not a one size fits all solution ● It is very useful for some sort of applications, but not for others ● It helps you to reduce persistence related code you write ● It may simplify queries to fetch data
  • 42. Conclusion ● “We can forget about/ignore SQL, because we are using Hibernate/JPA” thinking is a big mistake ● It is very easy to create performance bottlenecks in your applications while using ORM ● It has a steep learning curve, so be prepared before you start using it in your next big project!
  • 45. Contact ● Harezmi Bilişim Çözümleri A.Ş. ● http://www.harezmi.com.tr ● info@harezmi.com.tr