SlideShare a Scribd company logo
1 of 14
JPAstreamer
Problems
Mixing Hibernate/JPA and Java for Database actions
is neither completely type-sage nor intuitive.
Tedious process to switch between two languages
and HQL and JPQL syntax is wordy.
Solution
The Java Stream API is
 efficient, terse and type-safe
 intuitive to express application logic with java streams
Adding JPAstreamer make
Your database application
 efficient, terse and type-safe
 intuitive to express application logic with java streams
How it fits?
JPAstreamer is added as a lightweight dependency
to the Maven/Gradle build. It integrates with the
JPA layer by rendering the Stream queries to JPA
and passing them to the underlying JPA provider
for execution.
How it works?
This enriches the API of an existing JPA provider to include Java
Streams to express queries.
Key parts:
 The annotation processor
 Generates metamodel used to compose predicates that can be interpreted by the Stream
renderer
 The Stream renderer
 Inspects the Stream pipelines and renders optimized JPA queries.
Under the hood
 JPAstreamer uses and annotation processor to form a metamodel at compile
time
 It inspects any classes marked with the standard JPA annotation @Entity
 For every entity Foo.class, a corresponsing Foo$.class is generated
 Classes can take the form Foo$.firstName.startWith(“”) that can ne
interpreted by JPAstreamer’s query optimizer.
The Annotation Processor
Meta model
The Stream renderer
The StreamRenderer interface in
JPAStreamer is responsible for
converting the result set of a JPA
query into a stream of objects that
can be processed using Java Streams.
Thanks
MapStruct
The problem
 Need to map between different models
 View models vs DB models
 3rd party REST api vs DB model
 Types are similar, but not quite the same
Problem Solutions
 Manually
 Boring
 Error prone (might miss mapping)
 Reflection-based libraries
 Lack of type-safe
 Performance penalty
 Difficult debugging
MapStruct
 Mappings are defined as interfaces
 Mapping java code generated at compile time using annotation processor
 No reflection
 No runtime dependencies
Advantages of code generation
 Type-safe
 Quick feedback loop
 Easy to debug
 Plain method calls -> very fast
 No runtime dependencies
 Works on CLI or in your IDE

More Related Content

Similar to Accelerating Development.pptx

Spring Framework
Spring FrameworkSpring Framework
Spring Frameworknomykk
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412FirmansyahIrma1
 
Java2 platform
Java2 platformJava2 platform
Java2 platformSajan Sahu
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaAli Muzaffar
 
1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdfarpitaeron555
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruitersph7 -
 
Web Applications of the future: Combining JEE6 & JavaFX
Web Applications of the future: Combining JEE6 & JavaFXWeb Applications of the future: Combining JEE6 & JavaFX
Web Applications of the future: Combining JEE6 & JavaFXPaul Bakker
 
Spring from a to Z
Spring from  a to ZSpring from  a to Z
Spring from a to Zsang nguyen
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)Manisha Keim
 
Java and Related Technologies
Java and Related TechnologiesJava and Related Technologies
Java and Related TechnologiesQualys
 
Spring_Course_Content
Spring_Course_ContentSpring_Course_Content
Spring_Course_ContentMV Solutions
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2javatrainingonline
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureAllan Huang
 
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug Prediction
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug PredictionIt's Not a Bug, It's a Feature — How Misclassification Impacts Bug Prediction
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug Predictionsjust
 

Similar to Accelerating Development.pptx (20)

Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
Java Online Training
Java Online TrainingJava Online Training
Java Online Training
 
Java 8 Overview
Java 8 OverviewJava 8 Overview
Java 8 Overview
 
java web framework standard.20180412
java web framework standard.20180412java web framework standard.20180412
java web framework standard.20180412
 
Java2 platform
Java2 platformJava2 platform
Java2 platform
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf1. (with APA reference )Describe in detail the roles that the follow.pdf
1. (with APA reference )Describe in detail the roles that the follow.pdf
 
Java for Recruiters
Java for RecruitersJava for Recruiters
Java for Recruiters
 
Resthub lyonjug
Resthub lyonjugResthub lyonjug
Resthub lyonjug
 
Web Applications of the future: Combining JEE6 & JavaFX
Web Applications of the future: Combining JEE6 & JavaFXWeb Applications of the future: Combining JEE6 & JavaFX
Web Applications of the future: Combining JEE6 & JavaFX
 
Spring from a to Z
Spring from  a to ZSpring from  a to Z
Spring from a to Z
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Java and Related Technologies
Java and Related TechnologiesJava and Related Technologies
Java and Related Technologies
 
Spring_Course_Content
Spring_Course_ContentSpring_Course_Content
Spring_Course_Content
 
Eclipse
EclipseEclipse
Eclipse
 
Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2Java J2EE Interview Question Part 2
Java J2EE Interview Question Part 2
 
Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2Java J2EE Interview Questions Part 2
Java J2EE Interview Questions Part 2
 
eSobi Website Multilayered Architecture
eSobi Website Multilayered ArchitectureeSobi Website Multilayered Architecture
eSobi Website Multilayered Architecture
 
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug Prediction
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug PredictionIt's Not a Bug, It's a Feature — How Misclassification Impacts Bug Prediction
It's Not a Bug, It's a Feature — How Misclassification Impacts Bug Prediction
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Accelerating Development.pptx

  • 2. Problems Mixing Hibernate/JPA and Java for Database actions is neither completely type-sage nor intuitive. Tedious process to switch between two languages and HQL and JPQL syntax is wordy.
  • 3. Solution The Java Stream API is  efficient, terse and type-safe  intuitive to express application logic with java streams Adding JPAstreamer make Your database application  efficient, terse and type-safe  intuitive to express application logic with java streams
  • 4. How it fits? JPAstreamer is added as a lightweight dependency to the Maven/Gradle build. It integrates with the JPA layer by rendering the Stream queries to JPA and passing them to the underlying JPA provider for execution.
  • 5. How it works? This enriches the API of an existing JPA provider to include Java Streams to express queries. Key parts:  The annotation processor  Generates metamodel used to compose predicates that can be interpreted by the Stream renderer  The Stream renderer  Inspects the Stream pipelines and renders optimized JPA queries.
  • 6. Under the hood  JPAstreamer uses and annotation processor to form a metamodel at compile time  It inspects any classes marked with the standard JPA annotation @Entity  For every entity Foo.class, a corresponsing Foo$.class is generated  Classes can take the form Foo$.firstName.startWith(“”) that can ne interpreted by JPAstreamer’s query optimizer.
  • 8. The Stream renderer The StreamRenderer interface in JPAStreamer is responsible for converting the result set of a JPA query into a stream of objects that can be processed using Java Streams.
  • 11. The problem  Need to map between different models  View models vs DB models  3rd party REST api vs DB model  Types are similar, but not quite the same
  • 12. Problem Solutions  Manually  Boring  Error prone (might miss mapping)  Reflection-based libraries  Lack of type-safe  Performance penalty  Difficult debugging
  • 13. MapStruct  Mappings are defined as interfaces  Mapping java code generated at compile time using annotation processor  No reflection  No runtime dependencies
  • 14. Advantages of code generation  Type-safe  Quick feedback loop  Easy to debug  Plain method calls -> very fast  No runtime dependencies  Works on CLI or in your IDE