CHAIR FOR DATABASES AND INFORMATION SYSTEMS

Martin Braun - Bachelor Thesis presentation

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 September 2015

Integration of JPA-conform ORMImplementations in Hibernate Search

CONTACT

Martin Braun E-Mail

[email protected]

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

2

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

1. Introduction

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

-

Abstraction/standardization is key in the software world (Java Enterprise)

-

Database access is standardized -

Object Relational Mappers (ORM) Java Persistence API (JPA) -

-

Special features of different JPA implementations -

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

Hibernate ORM (Red Hat) EclipseLink (Eclipse Foundation) OpenJPA (Apache Foundation)

e.g. Hibernate Search

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

3

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

1. Introduction

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

What is Hibernate Search? -

Lucene based fulltext search engine on top of Hibernate ORM -

-

indexes and queries managed JPA objects keeps index up-to-date

Fulltext search in a regular RDBMS: SELECT book.id, book.name FROM book WHERE book.name LIKE %hobbit%;

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

Hibernate Search: more complex queries and index options -

fuzzy queries regular expression queries stemming (language specific) comprehensive synonym support

orignal hits original [Ll]ucene hits Lucene, lucene worker -> work book -> essay, album, novel

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

4

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

1. Introduction

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Hibernate Search with Hibernate ORM:

Hibernate ORM

notifies about changes > < retrieves objects from

controls access to >

Hibernate Search

indexes objects >

THURSDAY, 24 SEPTEMBER 2015

Database

CONTACT

Martin Braun E-Mail

[email protected]

Lucene Index

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

5

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

1. Introduction

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Hibernate Search with other JPA providers:

Non Hibernate JPA Provider

controls access to >

Hibernate Search

indexes objects >

THURSDAY, 24 SEPTEMBER 2015

Database

CONTACT

Martin Braun E-Mail

[email protected]

Lucene Index

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

6

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

1. Introduction

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Why a generic Hibernate Search? -

Other search solutions are not integrated with JPA: -

-

lack of integration results in: -

-

manual conversion into index objects required no automatic index updating no JPA objects as return values in queries

No new generic alternative needed: -

THURSDAY, 24 SEPTEMBER 2015

native Lucene ElasticSearch / Solr

existing JPA based interfaces in Hibernate Search backend (hibernate-search-engine) is integration agnostic

CONTACT

Martin Braun E-Mail

[email protected]

-

This approach is backed by the Hibernate team

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

7

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

2. Challenges

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

-

Hibernate Search Standalone -

-

JPA integration -

THURSDAY, 24 SEPTEMBER 2015

abstraction layer on-top of the low-level API of Hibernate Search’s engine

integration of the standalone with generic JPA re-use the interfaces from hibernate-search-orm

CONTACT

Martin Braun E-Mail

[email protected]

-

Automatic Updating Mechanism

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

8

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

3. Standalone Version of Hibernate Search

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

9

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

3. Standalone Version of Hibernate Search

10

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

3. Standalone Version of Hibernate Search

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

11

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

3. Standalone Version of Hibernate Search

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

12

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

4. JPA integration of the standalone version

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

13

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

5. Automatic Index Updating

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

-

Index must be kept up-to-date when database changes

-

Manual index updating is hard to maintain

-

Hibernate Search ORM: -

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

integrates with Hibernate ORMs event model does not work with direct database changes (SQL on DB, custom queries)

Candidates for Hibernate Search GenericJPA: -

1. JPA event based model 2. Native event based model similar to Hibernate Search ORM 3. Trigger based approach

synchronous synchronous asynchronous

14

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

5. Automatic Index Updating - JPA events

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Problems: -

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

JPA providers handle events differently

15

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

5. Automatic Index Updating - JPA events

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Problems: -

JPA providers handle events differently Events are triggered on flush

→ unusable for index updating

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

16

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

5. Automatic Index Updating - Native Events

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

-

All big JPA implementations (Hibernate ORM, EclipseLink, OpenJPA) have a native Listener mechanism

-

Native update mechanisms in Hibernate Search GenericJPA: -

-

Hibernate ORM EclipseLink

Same behaviour as Hibernate Search ORM’s mechanism → do not work with direct database changes (SQL on DB, custom queries)

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

-

Implementation is straight-forward, not part of thesis

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

17

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

5. Automatic Index Updating - Triggers

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

-

Triggers are supported by most RDBMSs

-

Not standardized, code abstraction needed for generation

-

Listen for changes directly in the database, write into auxiliary tables -

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

changes with native SQL are recognized support for legacy applications

18

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

5. Automatic Index Updating - Triggers

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

19

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

5. Automatic Index Updating - Triggers

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

20

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

6. Usage Example

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

21

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

7. Current situation

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

Hibernate Search without Hibernate ORM:

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

22

CHAIR FOR DATABASES AND INFORMATION SYSTEMS

8. Outlook

PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

-

Stable proof of concept

-

Source-code on GitHub: https://github.com/Hotware/Hibernate-Search-GenericJPA

-

Improvements in the trigger updating mechanism

-

Merge with core Hibernate Search in November 2015

23

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

24

CHAIR FOR DATABASES AND INFORMATION SYSTEMS PROF. DR.-ING. STEFAN JABLONSKI DR. BERNHARD VOLZ

THURSDAY, 24 SEPTEMBER 2015 CONTACT

Martin Braun E-Mail

[email protected]

Lucene Basics

© 2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH

What is Hibernate Search? - GitHub

2015 - MARTIN BRAUN - APPLIED COMPUTER SCIENCE IV, UNIVERSITY OF BAYREUTH. 1. Introduction. Hibernate Search with Hibernate ORM: Database.

2MB Sizes 5 Downloads 351 Views

Recommend Documents

What is NetBeans? - GitHub
A comprehensive, modular IDE. – Ready to use out of the box. – Support for latest Java specifications. & standards. – Other languages too. (PHP, C/C++, etc). – Intuitive workflow. – Debugger, Profiler,. Refactoring, etc. – Binaries & ZIPs

What Is AWS Icebreaker? - GitHub
physical devices from smart phone apps. The following diagram illustrates a high-level view of the Icebreaker service: You can interact with Icebreaker in a ...

What is structured prediction? - GitHub
9. Hal Daumé III ([email protected]). State of the art accuracy in.... ➢ Part of speech tagging (1 million words). ➢ wc: ... iPython Notebook for Learning to Search.

hibernate – natraj – satya - GitHub
... more materials. ------------ VISIT--------------------- http://ameerpetmaterials.blogspot.in/ http://ameerpetmatbooks.blogspot.in/ http://satyajohnny.blogspot.in/ ...

Spring and Hibernate Santosh'.pdf - GitHub
Download more materials. ------------ VISIT--------------------- http://ameerpetmaterials.blogspot.in/ http://ameerpetmatbooks.blogspot.in/.

What Is Search Engine Optimization Almost all About.PDF ...
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. What Is Search ...

What Is Search Engine Optimization Almost all About.PDF ...
Email Us: [email protected]. Page 1 of 1. What Is Search Engine Optimization Almost all About.PDF. What Is Search Engine Optimization Almost all ...

Some Announcements What Is Calibration? ...according to ... - GitHub
is defined as the process of quantitatively defining the system response to known, controlled signal inputs. ○ www.eumetsat.int/en/dps/helpdesk/glossary.html.

datasheet search site | www.alldatasheet.com - GitHub
Jun 1, 2007 - ADC accuracy (fPCLK2 = 14 MHz, fADC = 14 MHz, RAIN

datasheet search site | www.alldatasheet.com - GitHub
DESCRIPTION. The L78M00 series of three-terminal positive regulators is available in TO-220, TO-220FP,. DPAK and IPAK packages and with several fixed.

datasheet search site == www.icpdf.com - GitHub
Notebook Computers. Package Types. Figure 1. ... 由 Foxit PDF Editor 编 .... 9. Techcode®. 2A 32V Synchronous Rectified Step-Down Converter TD1519(A).

datasheet search site | www.alldatasheet.com - GitHub
The ACTR433A/433.92/TO39-1.5 is a true one-port, surface-acoustic-wave (SAW) resonator in a low-profile metal TO-39 case. It provides reliable ...

Text Search in Wade - GitHub
wr(t, q, d) = wm(t, d)[. 1. ∑ p∈ q(µ(p)). ] 1. q is a multiset. 2. µ(p) is the multiplicity of p in the multiset q. 3. ∑p∈ q(µ(p)) is the cardinality of the multiset q. This can be used to represent how much each term should affect the sco

C++ IS - GitHub
#ifndef __GameOfLife__Grid__. #define __GameOfLife__Grid__. #include "cocos2d.h". #include "Creature.h" class Grid : public cocos2d::Node. { public:.

What is Bitcoin? What is Cryptocurrency? Why ... Accounts
Virtual Currency and Taxation Part I. Amy Wall, Tucson Tax Team. ○ Silk Road was an online black market (aka darknet market) founded in February 2011 by the “Dread Pirate Roberts” (later found to be Ross Ulbricht). ○ Silk Road sold illegal su

What might research resolve? - GitHub
Call to action. • Call to action .... •Detecting luminous infrared galaxies (LIRGs) at redshift 7 will ... of view, and want to detect a 5 × 109 Mٖ galaxy at z ~ 2 (need ...

What is Strategy?
Laptop computers, mobile communica- tions, the Internet, and software such .... ten escort customers through the store, answering questions and helping them ...

What Is Real?
Page 3 .... lapping lines of thought make it clear that the core units of quan- tum field theory do not behave like billiard .... Second, let us suppose you had a particle localized in your ... they suer from their own diculties, and I stick to the s

What is Strategy?
assembling final products, and training employees. Cost is ... proaches are developed and as new inputs become ..... in automotive lubricants and does not offer other ...... competitive advantage in Competitive Advantage (New York: The Free.

Entity Recommendations in Web Search - GitHub
These queries name an entity by one of its names and might contain additional .... Our ontology was developed over 2 years by the Ya- ... It consists of 250 classes of entities ..... The trade-off between coverage and CTR is important as these ...

Hibernate in Action
Purchase of Hibernate in Action includes free access to a private web forum where you can ..... means in the context of object-oriented application development.

HIBERNATE - NATRAJ - SATYA.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. HIBERNATE - NATRAJ - SATYA.pdf. HIBERNATE - NATRAJ - SATYA.pdf. Open. Extract. Open with. Sign In. Main menu

Hibernate Tutorial
Alternatively, if you use an Integrated Development Environment (IDE) like .... the process more efficient than with other scripting languages (such as PHP) and ...

Hibernate Tutorial
... be used in combination with servlets that handle the business logic, the model ..... Specifies a list of packages or classes for use in the JSP as the Java import ..... Returns the Internet Protocol (IP) address of the client that sent the reques