Hibernate OGM Architecture

Similar documents
JPA. Java persistence API

Monday, October 31, 11

What data persistence means? We manipulate data (represented as object state) that need to be stored

Dali Java Persistence Tools. User Guide Release for Eclipse

Java Persistence API (JPA)

Dali Java Persistence Tools. User Guide Release 2.0 for Eclipse

CSE 530A. Lab 3. Washington University Fall 2013

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13

Object-Relational Mapping

Polyglot Persistence. EclipseLink JPA for NoSQL, Relational, and Beyond. Shaun Smith Gunnar Wagenknecht

Index. setmaxresults() method, 169 sorting, 170 SQL DISTINCT query, 171 uniqueresult() method, 169

Module 8 The Java Persistence API

EJB 3 Entity Relationships

Java EE Architecture, Part Three. Java EE architecture, part three 1(69)

Advanced Database Project: Document Stores and MongoDB

JPA Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

EJB 3 Entity Relationships

Dali Java Persistence Tools

ORM and JPA 2.0. Zdeněk Kouba, Petr Křemen

Architecture overview

Java EE Architecture, Part Three. Java EE architecture, part three 1(57)

Oracle Exam 1z0-898 Java EE 6 Java Persistence API Developer Certified Expert Exam Version: 8.0 [ Total Questions: 33 ]

ORM and JPA 2.0. Zdeněk Kouba, Petr Křemen

Holon Platform JPA Datastore Module - Reference manual. Version 5.2.1

Pro Hibernate and. MongoDB. Anghel Leonard. Apress-

ORM and JPA 2.0. Zdeněk Kouba, Petr Křemen

Database Connection using JPA. Working with the Java Persistence API (JPA) consists of using the following interfaces:

Selecting a Primary Key - 2

Deployment. See Packaging and deployment processes

How to Develop a Simple Crud Application Using Ejb3 and Web Dynpro

Running JPA Applications with Hibernate as a Third-Party Persistence Provider on SAP NetWeaver CE

The Good, the Bad and the Ugly

Setting Schema Name For Native Queries In. Hibernate >>>CLICK HERE<<<

Simba ODBC Driver with SQL Connector for MongoDB

Java Persistence Query Language (JPQL)

foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration

Extra Notes - Data Stores & APIs - using MongoDB and native driver

Building Java Persistence API Applications with Dali 1.0 Shaun Smith

EclipseLink. Solutions Guide for EclipseLink Release 2.6. June Beta Draft

MongoDB Introduction and Red Hat Integration Points. Chad Tindel Solution Architect

Java EE Architecture, Part Three. Java EE architecture, part three 1(24)

Sustainable Service Design using Xtext Michael Bischoff arvato Systems GmbH

MongoDB An Overview. 21-Oct Socrates

CO Java EE 6: Develop Database Applications with JPA

Java Persistence API. Patrick Linskey EJB Team Lead BEA Systems Oracle

Apache OpenJPA. Bean Validation Integration in JPA 2.0. July 17, Copyright 2009, The Apache Software Foundation

Real Application Security Administration

SQL Commands & Mongo DB New Syllabus

Java Persistence API (JPA) Entities

JAVA. 1. Introduction to JAVA

Fast Track to EJB 3.0 and the JPA Using JBoss

Chapter 7. The Annotations Alternative

Refactoring to Seam. NetBeans. Brian Leonard Sun Microsystems, Inc. 14o

Mappings and Queries. with. Hibernate

Holon Platform JPA Module - Reference manual. Version 5.2.1

Oracle Database. Installation and Configuration of Real Application Security Administration (RASADM) Prerequisites

Table of Contents. I. Pre-Requisites A. Audience B. Pre-Requisites. II. Introduction A. The Problem B. Overview C. History

EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Schema Management In Hibernate Interview. Questions >>>CLICK HERE<<<

Introduction to Java Enterprise Edition For Database Application Developer

Entities are classes that need to be persisted, usually in a relational database. In this chapter we cover the following topics:

JPA Enhancement Guide (v5.1)

Persistence Designer User s Guide. Version 3.4

ITG Software Engineering

find() method, 178 forclass() method, 162 getcurrentsession(), 16 getexecutablecriteria() method, 162 get() method, 17, 177 getreference() method, 178

JPA - ENTITY MANAGERS

Getting Started with the Bullhorn SOAP API and Java

Announcements. JSon Data Structures. JSon Syntax. JSon Semantics: a Tree! JSon Primitive Datatypes. Introduction to Database Systems CSE 414

1 Markus Eisele, Insurance - Strategic IT-Architecture

Making MongoDB Accessible to All. Brody Messmer Product Owner DataDirect On-Premise Drivers Progress Software

MongoDB Step By Step. By B.A.Khivsara Assistant Professor Department of Computer Engineering SNJB s COE,Chandwad

Automatically persisted among application sessions

MongoDB. History. mongodb = Humongous DB. Open-source Document-based High performance, high availability Automatic scaling C-P on CAP.

JPA The New Enterprise Persistence Standard

Wholesale Lockbox User Guide

WHAT IS EJB. Security. life cycle management.

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Xcalia Intermediation Core Mapping Quick Reference

Hibernate in close action. INF5750/ Lecture 3 (Part III)

A COMPONENT BASED ONLINE ORDERING SYSTEM USING ENTERPRISE JAVABEANS 3.0

Integration with third party evidence analyzers. Ver 9.6.0

Laszlo SZATHMARY University of Debrecen Faculty of Informatics

Information systems modelling UML and service description languages

Information systems modelling UML and service description languages

NoSQL: Redis and MongoDB A.A. 2016/17

Session 13. Reading. A/SettingUpJPA.htm JPA Best Practices

"Charting the Course... Mastering EJB 3.0 Applications. Course Summary

Introduction to Web Application Development Using JEE, Frameworks, Web Services and AJAX

Generation of EJB3 Artifacts in a Modeling Platform

Brad Dayley. Sams Teach Yourself. NoSQL with MongoDB. SAMS 800 East 96th Street, Indianapolis, Indiana, USA

Percona Live Santa Clara, California April 24th 27th, 2017

ECE 650 Systems Programming & Engineering. Spring 2018

Object-Relational Mapping Tools let s talk to each other!

JPA Tools Guide (v5.0)

1Z Java SE 5 and 6, Certified Associate Exam Summary Syllabus Questions

Lightweight J2EE Framework

Schema Null Cannot Be Resolved For Table Jpa

Object-relational mapping tools and Hibernate

B0B36DBS, BD6B36DBS: Database Systems

Transcription:

HIBERNATE OGM

Hibernate OGM Architecture

Hibernate OGM Architecture http://docs.jboss.org/hibernate/ogm/4.0/reference/en-us/html_single/

Data Persistence

How is Data Persisted Abstraction between the application object model and the persistent data model Persist data as basic types Keep the notion of primary key to address an entity Keep the notion of foreign key to link two entities

UserOne -userid -name -address composition -street -city -pin Address Tbl_userone userid_pk name street city pin

Key identifying an entity instance is composed of: the table name the primary key column name the primary key value Key Tbl_userone,userid,1 Value {userid=1, Name= Gerad, address.street= 18 th main, address.city= Bangalore, Address.pin= 5760041 }

-userid -name -address UserOne N N -addid -street -city -pin Address tbl_user -userid_pk -name tbl_user_address -userid_fk -addid_fk tbl_address -adddid_pk -street -city -pin

Key for association data is composed of: the table name the column name representing the foreign key to the entity we come from the column value representing the foreign key to the entity we come from

Key tbl_userone,userid_pk,1 tbl_userone,userid_pk,2 tbl_address,addid_pk,11 tbl_address,addid_pk,12 tbl_userone_address,userid_fk,1 tbl_userone_address,userid_fk,2 tbl_userone_address,addid_fk,11 tbl_userone_address,addid_fk,12 Value {userid_pk=1,name= Gerad } {userid_pk=2,name= Samuel } {addid_pk=11,street= 18 th main } {addid_pk=12,street= 20 th main } {{userid_fk=1,addid_fk=11}, {userid_fk=1,addid_fk=12}} {{userid_fk=2,addid_fk=13}, {userid_fk=3,addid_fk=14}} {{userid_fk=1,addid_fk=11}, {userid_fk=4,addid_fk=11}} {{userid_fk=1,addid_fk=12}, {userid_fk=5,addid_fk=12}}

Querying Data

http://docs.jboss.org/hibernate/ogm/4.0/reference/en-us/html_single/

Hibernate OGM Configuration

Persistence.xml <?xml version="1.0"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/ xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name= HibOGMPU" transaction-type="jta"> <provider>org.hibernate.ogm.jpa.hibernateogmpersistence</provider> <properties> <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.jbossstandalonejtaplatform" /> <property name="hibernate.ogm.datastore.provider" value= mongo" /> </properties> </persistence-unit> </persistence>

MongoDB Installation and Configuration

MongoDB Installation Download the open source mongodb from http://www.mongodb.org/downloads (version 2.0.4) and unzip in a directory Create Directory c:\data\db for data files (or specify alternate path using - - dbpath argument) Starting MongoDB from the Command Prompt From the unzipped directory go to bin Execute mongod.exe (or) mongod --dbpath D:\data\db (since the default C:\data\db is changed to D:\data\db it has to be specified explicitly)

MongoDB Installation a. http://localhost:28017/ - to check if it is working as in the next slide b. Press <Ctrl c> on the shell running the server, to stop the service c. Open another command prompt à go to bin directory à execute mongo.exe (mongodb JavaScript shell)

Hibernate OGM Configuration For MongoDB

Hibernate OGM MongoDB hibernate.ogm.datastore.provider mongodb hibernate.ogm.mongodb.host default value is 127.0.0.1 hibernate.ogm.mongodb.port default value is 27017 hibernate.ogm.mongodb.database hibernate.ogm.mongodb.username hibernate.ogm.mongodb.password hibernate.ogm.mongodb.safe hibernate.ogm.mongodb.connection _timeout hibernate.ogm.mongodb.association s.store no default value Mongo username Mongo password default value is true. expressed in milliseconds. The default value is 5000. GLOBAL_COLLECTION/ COLLECTION/ IN_ENTITY

Entity Classes

Entity class @Entity public class UserOne { @Id private String userid; private String name; @Column(name="desc") private String description; //getters, setters... }

: Mongo JSON Document { "_id" : "5678-9999-0123-8553", name": Gerad", "desc": Male aged 32", }

Primary Keys and Identifiers

Composite Primary Key @Entity public class Employee { @EmbeddedId private IDClass id; //getters, setters... } @Embeddable public class IDClass implements Serializable { private String empid; private String deptid; //getters, setters... }

JSON Representation { "_id" :{ empid": 11234", deptid": 777" } }

Association Strategies

Association Strategies IN_ENTITY (default) GLOBAL_COLLECTION COLLECTION

Association Relationship Between Entities

Generators and DataTypes JPA id generators are supported: IDENTITY SEQUENCE TABLE AUTO Java Types Supported: Boolean Byte Calendar (this may change) Class (this may change)

Generators and DataTypes Java Types Supported: Date (this may change) Double Integer Long Byte Array String Types Maapped as String: BigDecimal BigInteger Url UUID

Supported Associations @OneToOne @OneToMany @ManyToOne @ManyToMany

Querying MongoDB

Query Support Hibernate Search FullTextQueries Native query technology of MongoDB. While using JPQL : Limitations are: No join, aggregation, or other relational operations Use Hibernate Session API The entities and properties are indexed by Hibernate Search Criteria API not implemented yet

Q&A

Thank you