SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Chicago, October 19 - 22,
2010
New Persistence Features in
Spring Roo 1.1
Stefan Schmidt
Agenda
•  Spring Roo’s Approach to Persistence
•  Incremental Database Reverse Engineering
•  Apache Solr / Lucene Integration
•  Alternative Persistence Technologies
Spring Roo’s Approach to
Persistence
Peristence Choices
•  JPA2 for ORM
–  4 choices of ORM providers
•  Hibernate
•  EclipseLink
•  OpenJPA
•  DataNucleus (DN1 supported for GAE, DN2 used by VMforce)
•  12+ Database choices
–  constantly growning list of DBs to choose from
–  popular ones: MySQL, Postgres, HSQLDB (for dev)
•  Switch out ORM and / or DB with a single command
–  persistence setup --provider HIBERNATE --database MYSQL
No DAOs?
•  No DAO layer by default
–  Objections:
•  testing
•  separation of concern
•  pluggable implementations
•  non JPA persistence
•  security authorizations
•  security auditing
•  finders
•  architectural reasons
Feature Extension Points
•  Add-ons can contribute persistence feature extensions via
ITDs
–  Finder add-on is a good example
•  Every @RooEntity exposes the JPA entity manager
–  use for creating custom type-safe queries via Criteria API
–  getting access to the underlying ORM
Incremental Database
Reverse Engineering
Alternatives to Roo’s Incremental DBRE
•  Eclipse “JPA Entities from tables” wizard
–  Generates entities from a JDBC connection
–  Can be tailored to change generated type and field names
–  Does not handle tables with no primary keys
•  JPA Implementation Tools
Limitations of Existing DBRE Tools
•  Lack of incremental reverse engineering
•  Complex and long-winded wizard style interactions
•  Missing entity lifecycle management
–  Application requires manual adjustment if the datamodel
changes
Introducing Roo’s Incremental Database
Reverse Engineering
•  DBRE was the most requested feature for Spring Roo
•  Introspect relational databases such as Oracle, MySQL,
PostgreSQL and Microsoft SQL Server
•  Reverse engineer complex schemas into Java entities in
seconds
•  Creates and maintains relationships with JPA 2.0
annotations
•  Incrementally updates your domain model as your DB
schema changes
How does DBRE work?
•  Uses the standard java.sql.DatabaseMetaData
implementation of your JDK
•  Connects to a live database using JDBC and creates
entities from the database metadata obtained
•  Similar to the output generated by the Eclipse wizard with
all accepted defaults
Spring Roo DBRE Commands
•  database introspect --schema <name> [--file <name>]
–  Displays database metadata in XML format in the Roo shell
–  Optional --file <file name> saves metadata to specified file
–  Provides a preview of the mappings used in the final model
Spring Roo DBRE Commands
•  database reverse engineer [--schema <name>] [--
package <name>]
–  Creates entities in the specified package
–  --schema and --package options required only for first time
run of command
–  Automatically generates type and field names from table
and column names
–  JPA-annotated fields and getters/setters saved in AspectJ
ITDs, eg Person_Roo_DbManaged.aj
Primary Keys
•  Supports single and composite primary keys
–  Creates a separate primary key class for tables having more
than one primary key or no primary key (uses all fields for
key)
–  Annotates the primary key class with @Embeddable and the
entity's id with @EmbeddedId
Entity Relationships
•  Automatically creates and maintains bi-directional
relationships:
–  @ManyToMany, many-valued associations with many-to-
many multiplicity
–  @OneToOne, single-valued associations to other entities
that have one-to-one multiplicity
–  @OneToMany, many-valued associations with one-to-many
multiplicity
–  @ManyToOne, single-valued associations to other entities
that have many-to-one multiplicity
DEMO
Database Reverse Engineering Demo
Apache Solr / Lucene
Integration
What is Apache Solr?
•  Search server
•  Built upon Apache Lucene (Java)
•  Fast, very
•  Scalable, query load and collection size
•  Distributed search and index replication
•  Interoperable
•  Extensible
Solr Features
•  Powerful full-text search
•  Hit highlighting
•  Faceted search
•  Spell checking
•  Dynamic clustering
•  Database integration
•  Rich document (e.g., Word, PDF) handling.
Interacting with Solr
•  HTTP GET / POST
•  JSON / XML
•  SolrJ (embedded over HTTP)
•  Ruby: solr-ruby, RSolr
•  many others: python, PHP, solrsharp, XSLT
•  JMX monitoring available
•  Admin interface available
Configuring Solr
•  schema.xml
–  Defines field types
–  Can drive more intelligent processing
–  Dynamic Fields enable on-the-fly addition of new fields
–  CopyField
•  indexing a single field multiple ways
•  combining multiple fields into a single searchable field
–  Many additional text analysis components
•  word splitting,
•  regex filters
•  sounds-like filters
Roo Solr Integration
•  Roo Shell
–  solr setup  install SolrJ driver in project pom.xml
–  solr add  make individual type searchable
–  solr all  make all JPA entities searchable
•  @RooSolrSearchable type annotation
•  Hooks into JPA lifecycle
–  @PostPersist
–  @PostUpdate
–  @PreDelete
•  Uses SolrJ client
Entity Methods Introduced via Roo
•  QueryResponse search(String queryString)
•  QueryResponse search(SolrQuery query)
•  @Async void indexPerson(Person person)
•  @Async void indexPeople(Collection<Person> people)
•  @Async deleteIndex(Owner owner)
•  solrServer is also accessible on target type.
DEMO
Apache Solr
Alternative Persistence
Technologies
Demand for Choice
•  ROO-301: Choose between data access patterns
–  demand for repository and DAO pattern support
•  70+ votes in Spring Roo Jira, second most popular issue
–  Spring JDBC template
–  demand for iBatis support (ROO-452)
–  demand for NoSQL integration
–  demand for polyglot persistence
Hades Add-On
•  Have you heard of Hades project?
–  Utility library to work with Data Access Objects
•  implemented with Spring and JPA
–  Main goal is to ease the development and operation of a
data access layer in applications
•  Installation in the Roo shell with a single command:
–  addon install --bundleSymbolicName org.synyx.hades.roo.addon
–  hades setup
–  hades repository --entity ~.domain.Person
–  more features planned (finders, DDD, etc)
DEMO
Hades Add-On
Summary
•  Roo has deep and rich persistence support
•  Roo’s Incremental DBRE feature is the next generation in
DBRE capabilities
•  Solr and Incremental DBRE offer devs a major
productivity boost
•  Alternative persistence technologies supported and
expanding

Contenu connexe

Tendances

Apache Solr/Lucene Internals by Anatoliy Sokolenko
Apache Solr/Lucene Internals  by Anatoliy SokolenkoApache Solr/Lucene Internals  by Anatoliy Sokolenko
Apache Solr/Lucene Internals by Anatoliy SokolenkoProvectus
 
Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1PgTraining
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr DevelopersErik Hatcher
 
High Performance JSON Search and Relational Faceted Browsing with Lucene
High Performance JSON Search and Relational Faceted Browsing with LuceneHigh Performance JSON Search and Relational Faceted Browsing with Lucene
High Performance JSON Search and Relational Faceted Browsing with Lucenelucenerevolution
 
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to OpportunityEqunix Business Solutions
 
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, Lucidworks
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, LucidworksApache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, Lucidworks
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, LucidworksLucidworks
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache SolrAndy Jackson
 
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using MorphlinesLarge Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using Morphlineswhoschek
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and SparkLucidworks
 
Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1YI-CHING WU
 
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Michael Rys
 
Webinar: What's New in Solr 7
Webinar: What's New in Solr 7 Webinar: What's New in Solr 7
Webinar: What's New in Solr 7 Lucidworks
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2PgTraining
 
Integrating the Solr search engine
Integrating the Solr search engineIntegrating the Solr search engine
Integrating the Solr search engineth0masr
 
Solr Indexing and Analysis Tricks
Solr Indexing and Analysis TricksSolr Indexing and Analysis Tricks
Solr Indexing and Analysis TricksErik Hatcher
 

Tendances (20)

How Solr Search Works
How Solr Search WorksHow Solr Search Works
How Solr Search Works
 
Apache Solr/Lucene Internals by Anatoliy Sokolenko
Apache Solr/Lucene Internals  by Anatoliy SokolenkoApache Solr/Lucene Internals  by Anatoliy Sokolenko
Apache Solr/Lucene Internals by Anatoliy Sokolenko
 
Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1Oracle to Postgres Migration - part 1
Oracle to Postgres Migration - part 1
 
Solr 4
Solr 4Solr 4
Solr 4
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Lucene for Solr Developers
Lucene for Solr DevelopersLucene for Solr Developers
Lucene for Solr Developers
 
High Performance JSON Search and Relational Faceted Browsing with Lucene
High Performance JSON Search and Relational Faceted Browsing with LuceneHigh Performance JSON Search and Relational Faceted Browsing with Lucene
High Performance JSON Search and Relational Faceted Browsing with Lucene
 
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
[EPPG] Oracle to PostgreSQL, Challenges to Opportunity
 
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, Lucidworks
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, LucidworksApache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, Lucidworks
Apache Solr: Upgrading Your Upgrade Experience - Hrishikesh Gadre, Lucidworks
 
Introduction to Apache Solr
Introduction to Apache SolrIntroduction to Apache Solr
Introduction to Apache Solr
 
Oracle by Muhammad Iqbal
Oracle by Muhammad IqbalOracle by Muhammad Iqbal
Oracle by Muhammad Iqbal
 
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using MorphlinesLarge Scale ETL for Hadoop and Cloudera Search using Morphlines
Large Scale ETL for Hadoop and Cloudera Search using Morphlines
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and Spark
 
Search at Twitter
Search at TwitterSearch at Twitter
Search at Twitter
 
Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1Introduction to Lucene and Solr - 1
Introduction to Lucene and Solr - 1
 
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
Best practices on Building a Big Data Analytics Solution (SQLBits 2018 Traini...
 
Webinar: What's New in Solr 7
Webinar: What's New in Solr 7 Webinar: What's New in Solr 7
Webinar: What's New in Solr 7
 
Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2Oracle to Postgres Migration - part 2
Oracle to Postgres Migration - part 2
 
Integrating the Solr search engine
Integrating the Solr search engineIntegrating the Solr search engine
Integrating the Solr search engine
 
Solr Indexing and Analysis Tricks
Solr Indexing and Analysis TricksSolr Indexing and Analysis Tricks
Solr Indexing and Analysis Tricks
 

En vedette

Pandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 DPandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 Dguest7a4f92
 
Next Generation Spring MVC with Spring Roo
Next Generation Spring MVC with Spring RooNext Generation Spring MVC with Spring Roo
Next Generation Spring MVC with Spring RooStefan Schmidt
 
Powerpoint version of question two
Powerpoint version of question twoPowerpoint version of question two
Powerpoint version of question twoLeon Thomas
 
World Music Week 3 Presentation
World Music Week 3 PresentationWorld Music Week 3 Presentation
World Music Week 3 Presentationguest7a4f92
 
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than Ever
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than EverJava Enterprise Applications in the Cloud: Fast, Fun and Easier than Ever
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than EverStefan Schmidt
 
At home-animated.ppt
At home-animated.pptAt home-animated.ppt
At home-animated.pptmbosch59
 
World cup week 4 presentation
World cup week 4 presentationWorld cup week 4 presentation
World cup week 4 presentationguest7a4f92
 

En vedette (20)

Mr. Alan Cowen
Mr. Alan CowenMr. Alan Cowen
Mr. Alan Cowen
 
Pandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 DPandemics Week 3 Presentation Summary 1 D
Pandemics Week 3 Presentation Summary 1 D
 
Next Generation Spring MVC with Spring Roo
Next Generation Spring MVC with Spring RooNext Generation Spring MVC with Spring Roo
Next Generation Spring MVC with Spring Roo
 
C:\fakepath\ch 1 intro_to_ob
C:\fakepath\ch 1 intro_to_obC:\fakepath\ch 1 intro_to_ob
C:\fakepath\ch 1 intro_to_ob
 
Creative commons folkbildning
Creative commons folkbildningCreative commons folkbildning
Creative commons folkbildning
 
Cckth
CckthCckth
Cckth
 
Powerpoint version of question two
Powerpoint version of question twoPowerpoint version of question two
Powerpoint version of question two
 
Arima i Hais
Arima i HaisArima i Hais
Arima i Hais
 
Openspace isoc
Openspace isocOpenspace isoc
Openspace isoc
 
World Music Week 3 Presentation
World Music Week 3 PresentationWorld Music Week 3 Presentation
World Music Week 3 Presentation
 
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than Ever
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than EverJava Enterprise Applications in the Cloud: Fast, Fun and Easier than Ever
Java Enterprise Applications in the Cloud: Fast, Fun and Easier than Ever
 
Sociala medier läromedel
Sociala medier läromedelSociala medier läromedel
Sociala medier läromedel
 
Ung företagande och Webbstjärnan
Ung företagande och WebbstjärnanUng företagande och Webbstjärnan
Ung företagande och Webbstjärnan
 
Ms. Nolwenn Bertrand
Ms. Nolwenn BertrandMs. Nolwenn Bertrand
Ms. Nolwenn Bertrand
 
Internetiskolan Webbstjarnan
Internetiskolan WebbstjarnanInternetiskolan Webbstjarnan
Internetiskolan Webbstjarnan
 
At home-animated.ppt
At home-animated.pptAt home-animated.ppt
At home-animated.ppt
 
Upphovsrätt och Källkritik Åva
Upphovsrätt och Källkritik ÅvaUpphovsrätt och Källkritik Åva
Upphovsrätt och Källkritik Åva
 
Twitter för oss #smp10 Boras
Twitter för oss #smp10 BorasTwitter för oss #smp10 Boras
Twitter för oss #smp10 Boras
 
World cup week 4 presentation
World cup week 4 presentationWorld cup week 4 presentation
World cup week 4 presentation
 
digitalaverktyg-skolan
digitalaverktyg-skolandigitalaverktyg-skolan
digitalaverktyg-skolan
 

Similaire à New Persistence Features in Spring Roo 1.1

hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfPatiento Del Mar
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesBrett Meyer
 
Hibernate in XPages
Hibernate in XPagesHibernate in XPages
Hibernate in XPagesToby Samples
 
NoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache HadoopNoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache HadoopDmitry Kan
 
Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum
 
Apache Solr - Enterprise search platform
Apache Solr - Enterprise search platformApache Solr - Enterprise search platform
Apache Solr - Enterprise search platformTommaso Teofili
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to SolrErik Hatcher
 
No sql and sql - open analytics summit
No sql and sql - open analytics summitNo sql and sql - open analytics summit
No sql and sql - open analytics summitOpen Analytics
 
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchBigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchNetConstructor, Inc.
 
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote   Yonik Seeley & Steve Rowe lucene solr roadmapKeynote   Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote Yonik Seeley & Steve Rowe lucene solr roadmaplucenerevolution
 
KEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road mapKEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road maplucenerevolution
 
From Lucene to Solr 4 Trunk
From Lucene to Solr 4 TrunkFrom Lucene to Solr 4 Trunk
From Lucene to Solr 4 Trunktdthomassld
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...OpenBlend society
 
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir VolkSpark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir VolkSpark Summit
 
Solr search engine with multiple table relation
Solr search engine with multiple table relationSolr search engine with multiple table relation
Solr search engine with multiple table relationJay Bharat
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 

Similaire à New Persistence Features in Spring Roo 1.1 (20)

hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
Hibernate in XPages
Hibernate in XPagesHibernate in XPages
Hibernate in XPages
 
NoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache HadoopNoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache Hadoop
 
Oracle OpenWo2014 review part 03 three_paa_s_database
Oracle OpenWo2014 review part 03 three_paa_s_databaseOracle OpenWo2014 review part 03 three_paa_s_database
Oracle OpenWo2014 review part 03 three_paa_s_database
 
Infinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORMInfinum Android Talks #09 - DBFlow ORM
Infinum Android Talks #09 - DBFlow ORM
 
Apache Solr - Enterprise search platform
Apache Solr - Enterprise search platformApache Solr - Enterprise search platform
Apache Solr - Enterprise search platform
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
 
No sql and sql - open analytics summit
No sql and sql - open analytics summitNo sql and sql - open analytics summit
No sql and sql - open analytics summit
 
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearchBigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
BigData Faceted Search Comparison between Apache Solr vs. ElasticSearch
 
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote   Yonik Seeley & Steve Rowe lucene solr roadmapKeynote   Yonik Seeley & Steve Rowe lucene solr roadmap
Keynote Yonik Seeley & Steve Rowe lucene solr roadmap
 
KEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road mapKEYNOTE: Lucene / Solr road map
KEYNOTE: Lucene / Solr road map
 
From Lucene to Solr 4 Trunk
From Lucene to Solr 4 TrunkFrom Lucene to Solr 4 Trunk
From Lucene to Solr 4 Trunk
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
Apache drill
Apache drillApache drill
Apache drill
 
Spark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir VolkSpark Summit EU talk by Shay Nativ and Dvir Volk
Spark Summit EU talk by Shay Nativ and Dvir Volk
 
Solr search engine with multiple table relation
Solr search engine with multiple table relationSolr search engine with multiple table relation
Solr search engine with multiple table relation
 
Sql Server2008
Sql Server2008Sql Server2008
Sql Server2008
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
Solr
SolrSolr
Solr
 

Dernier

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Dernier (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

New Persistence Features in Spring Roo 1.1

  • 1. Chicago, October 19 - 22, 2010 New Persistence Features in Spring Roo 1.1 Stefan Schmidt
  • 2. Agenda •  Spring Roo’s Approach to Persistence •  Incremental Database Reverse Engineering •  Apache Solr / Lucene Integration •  Alternative Persistence Technologies
  • 3. Spring Roo’s Approach to Persistence
  • 4. Peristence Choices •  JPA2 for ORM –  4 choices of ORM providers •  Hibernate •  EclipseLink •  OpenJPA •  DataNucleus (DN1 supported for GAE, DN2 used by VMforce) •  12+ Database choices –  constantly growning list of DBs to choose from –  popular ones: MySQL, Postgres, HSQLDB (for dev) •  Switch out ORM and / or DB with a single command –  persistence setup --provider HIBERNATE --database MYSQL
  • 5. No DAOs? •  No DAO layer by default –  Objections: •  testing •  separation of concern •  pluggable implementations •  non JPA persistence •  security authorizations •  security auditing •  finders •  architectural reasons
  • 6. Feature Extension Points •  Add-ons can contribute persistence feature extensions via ITDs –  Finder add-on is a good example •  Every @RooEntity exposes the JPA entity manager –  use for creating custom type-safe queries via Criteria API –  getting access to the underlying ORM
  • 8. Alternatives to Roo’s Incremental DBRE •  Eclipse “JPA Entities from tables” wizard –  Generates entities from a JDBC connection –  Can be tailored to change generated type and field names –  Does not handle tables with no primary keys •  JPA Implementation Tools
  • 9. Limitations of Existing DBRE Tools •  Lack of incremental reverse engineering •  Complex and long-winded wizard style interactions •  Missing entity lifecycle management –  Application requires manual adjustment if the datamodel changes
  • 10. Introducing Roo’s Incremental Database Reverse Engineering •  DBRE was the most requested feature for Spring Roo •  Introspect relational databases such as Oracle, MySQL, PostgreSQL and Microsoft SQL Server •  Reverse engineer complex schemas into Java entities in seconds •  Creates and maintains relationships with JPA 2.0 annotations •  Incrementally updates your domain model as your DB schema changes
  • 11. How does DBRE work? •  Uses the standard java.sql.DatabaseMetaData implementation of your JDK •  Connects to a live database using JDBC and creates entities from the database metadata obtained •  Similar to the output generated by the Eclipse wizard with all accepted defaults
  • 12. Spring Roo DBRE Commands •  database introspect --schema <name> [--file <name>] –  Displays database metadata in XML format in the Roo shell –  Optional --file <file name> saves metadata to specified file –  Provides a preview of the mappings used in the final model
  • 13. Spring Roo DBRE Commands •  database reverse engineer [--schema <name>] [-- package <name>] –  Creates entities in the specified package –  --schema and --package options required only for first time run of command –  Automatically generates type and field names from table and column names –  JPA-annotated fields and getters/setters saved in AspectJ ITDs, eg Person_Roo_DbManaged.aj
  • 14. Primary Keys •  Supports single and composite primary keys –  Creates a separate primary key class for tables having more than one primary key or no primary key (uses all fields for key) –  Annotates the primary key class with @Embeddable and the entity's id with @EmbeddedId
  • 15. Entity Relationships •  Automatically creates and maintains bi-directional relationships: –  @ManyToMany, many-valued associations with many-to- many multiplicity –  @OneToOne, single-valued associations to other entities that have one-to-one multiplicity –  @OneToMany, many-valued associations with one-to-many multiplicity –  @ManyToOne, single-valued associations to other entities that have many-to-one multiplicity
  • 17. Apache Solr / Lucene Integration
  • 18. What is Apache Solr? •  Search server •  Built upon Apache Lucene (Java) •  Fast, very •  Scalable, query load and collection size •  Distributed search and index replication •  Interoperable •  Extensible
  • 19. Solr Features •  Powerful full-text search •  Hit highlighting •  Faceted search •  Spell checking •  Dynamic clustering •  Database integration •  Rich document (e.g., Word, PDF) handling.
  • 20. Interacting with Solr •  HTTP GET / POST •  JSON / XML •  SolrJ (embedded over HTTP) •  Ruby: solr-ruby, RSolr •  many others: python, PHP, solrsharp, XSLT •  JMX monitoring available •  Admin interface available
  • 21. Configuring Solr •  schema.xml –  Defines field types –  Can drive more intelligent processing –  Dynamic Fields enable on-the-fly addition of new fields –  CopyField •  indexing a single field multiple ways •  combining multiple fields into a single searchable field –  Many additional text analysis components •  word splitting, •  regex filters •  sounds-like filters
  • 22. Roo Solr Integration •  Roo Shell –  solr setup  install SolrJ driver in project pom.xml –  solr add  make individual type searchable –  solr all  make all JPA entities searchable •  @RooSolrSearchable type annotation •  Hooks into JPA lifecycle –  @PostPersist –  @PostUpdate –  @PreDelete •  Uses SolrJ client
  • 23. Entity Methods Introduced via Roo •  QueryResponse search(String queryString) •  QueryResponse search(SolrQuery query) •  @Async void indexPerson(Person person) •  @Async void indexPeople(Collection<Person> people) •  @Async deleteIndex(Owner owner) •  solrServer is also accessible on target type.
  • 26. Demand for Choice •  ROO-301: Choose between data access patterns –  demand for repository and DAO pattern support •  70+ votes in Spring Roo Jira, second most popular issue –  Spring JDBC template –  demand for iBatis support (ROO-452) –  demand for NoSQL integration –  demand for polyglot persistence
  • 27. Hades Add-On •  Have you heard of Hades project? –  Utility library to work with Data Access Objects •  implemented with Spring and JPA –  Main goal is to ease the development and operation of a data access layer in applications •  Installation in the Roo shell with a single command: –  addon install --bundleSymbolicName org.synyx.hades.roo.addon –  hades setup –  hades repository --entity ~.domain.Person –  more features planned (finders, DDD, etc)
  • 29. Summary •  Roo has deep and rich persistence support •  Roo’s Incremental DBRE feature is the next generation in DBRE capabilities •  Solr and Incremental DBRE offer devs a major productivity boost •  Alternative persistence technologies supported and expanding