SlideShare a Scribd company logo
1 of 14
nHibernate Query Albert Kuo
How nHibernation work? nHibernateQuery basic query Restriction String matcher Dynamic queries Subqueries Using Dynamic Institation Agenda 2
How nHibernation work? Utilize session to  manipulate VOs Criteria Session tables VOs VOs VOs Configuration SessionFactory VOs 3
How nHibernation work? – cont. create update 4
How nHibernation work? – cont. delete find 5
nHibernate Query Criteria API Hibernate Query Language Object oriented querying Increase compile-time syntax-checking Easy to write Hard to read String-based querying Object-Oriented SQL Similar to SQL Speak in terms of objects Case sensitive Very flexible Zero compile-time syntax-checking 6
Using the ICriteriainterface: ICriteriacriteria = session.CreateCriteria(typeof(Cases)); Generate SQL statement: select cases0_.caseId as caseId0_, cases0_.caseDesc as caseDesc0_, cases0_.caseTime as caseTime0_, cases0_.caseType as caseType0_, cases0_.caseAddr as caseAddr0_, cases0_.reporterStaff as reporter6_0_, cases0_.reporterPhone as reporter7_0_, cases0_.reporterAddr as reporter8_0_, cases0_.receiverStaff as receiver9_0_, cases0_.receiveTime as receive10_0_, cases0_.caseState as caseState0_, cases0_.updtDate as updtDate0_, cases0_.county as county0_, cases0_.town as town0_, cases0_.caseClass as caseClass0_ from Cases cases0_ nHibernate Query – basic query 7
You usually don’t want to retrieve all instances of a class when you run a query. Instead, you want to express some constraints on the property values of your objects, so only a subset of objects is retrieved. This is called restriction. nHibernate Query – Restriction 8
The like operator allows wildcard searches, where the wildcard symbols are % and _ nHibernate Query – String matcher 9
It’s common for queries to be built programmatically by combining several optional query criteria depending on user input. nHibernate Query – Dynamic queries 10
11
nHibernate Query – Subqueries 12
If you find working with arrays of values a little cumbersome, NHibernate let’s you use dynamic instantiation and define a class to represent each row of results. You can do this using the HQL select new construct: The custom ItemRow class doesn’t have to be a persistent class that has its own mapping file. But in order for NHibernate to “see” it, you need to import it using nHibernate Query – Using Dynamic Institation 13
Chapter 11. HQL: The Hibernate Query Language https://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html NHibernate in Action http://www.manning.com/kuate/ Reference 14

More Related Content

What's hot

Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJSAbul Hasan
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operatorsVivek Kumar
 
A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkESUG
 
Qtp training session IV
Qtp training session IVQtp training session IV
Qtp training session IVAisha Mazhar
 
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...LEDC 2016
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesMarcus Denker
 

What's hot (6)

Introduction to RxJS
Introduction to RxJSIntroduction to RxJS
Introduction to RxJS
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operators
 
A low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for SmalltalkA low Overhead Per Object Write Barrier for Smalltalk
A low Overhead Per Object Write Barrier for Smalltalk
 
Qtp training session IV
Qtp training session IVQtp training session IV
Qtp training session IV
 
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
 
Dynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection PromisesDynamically Composing Collection Operations through Collection Promises
Dynamically Composing Collection Operations through Collection Promises
 

Viewers also liked

Structure of c
Structure of cStructure of c
Structure of cdevauro
 
Control Structure in C
Control Structure in CControl Structure in C
Control Structure in CNeel Shah
 
Lecture18 structurein c.ppt
Lecture18 structurein c.pptLecture18 structurein c.ppt
Lecture18 structurein c.ppteShikshak
 
C programming string
C  programming stringC  programming string
C programming stringargusacademy
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++ Samsil Arefin
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_outputAnil Dutt
 
Array in c language
Array in c languageArray in c language
Array in c languagesanjay joshi
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C ProgrammingDevoAjit Gupta
 
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a   Rangkaian Aritmatik-Half n Full AdderPertemuan 3a   Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adderahmad haidaroh
 
C programming - String
C programming - StringC programming - String
C programming - StringAchyut Devkota
 
Arrays In C Language
Arrays In C LanguageArrays In C Language
Arrays In C LanguageSurbhi Yadav
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : ArraysGagan Deep
 

Viewers also liked (20)

Structure of c
Structure of cStructure of c
Structure of c
 
14 strings
14 strings14 strings
14 strings
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
Control Structure in C
Control Structure in CControl Structure in C
Control Structure in C
 
C pointer basics
C pointer basicsC pointer basics
C pointer basics
 
Lecture18 structurein c.ppt
Lecture18 structurein c.pptLecture18 structurein c.ppt
Lecture18 structurein c.ppt
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
C programming string
C  programming stringC  programming string
C programming string
 
String in programming language in c or c++
 String in programming language  in c or c++  String in programming language  in c or c++
String in programming language in c or c++
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
Array in-c
Array in-cArray in-c
Array in-c
 
Array in c language
Array in c languageArray in c language
Array in c language
 
Strings Functions in C Programming
Strings Functions in C ProgrammingStrings Functions in C Programming
Strings Functions in C Programming
 
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a   Rangkaian Aritmatik-Half n Full AdderPertemuan 3a   Rangkaian Aritmatik-Half n Full Adder
Pertemuan 3a Rangkaian Aritmatik-Half n Full Adder
 
C programming - String
C programming - StringC programming - String
C programming - String
 
String in c
String in cString in c
String in c
 
Structure in c
Structure in cStructure in c
Structure in c
 
Structure in C
Structure in CStructure in C
Structure in C
 
Arrays In C Language
Arrays In C LanguageArrays In C Language
Arrays In C Language
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 

Similar to nHibernate Query

Hibernate for Beginners
Hibernate for BeginnersHibernate for Beginners
Hibernate for BeginnersRamesh Kumar
 
Advanced Hibernate Notes
Advanced Hibernate NotesAdvanced Hibernate Notes
Advanced Hibernate NotesKaniska Mandal
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Mohamed Saleh
 
Hibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersHibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersAnuragMourya8
 
Bytebuf vs DirectByteBuffer
Bytebuf vs DirectByteBufferBytebuf vs DirectByteBuffer
Bytebuf vs DirectByteBufferMichael Fong
 
Hibernate jj
Hibernate jjHibernate jj
Hibernate jjJoe Jacob
 
Java script performance tips
Java script performance tipsJava script performance tips
Java script performance tipsShakti Shrestha
 
nHibernate Caching
nHibernate CachingnHibernate Caching
nHibernate CachingGuo Albert
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Trainingsourabh aggarwal
 
REST::Neo4p - Talk @ DC Perl Mongers
REST::Neo4p - Talk @ DC Perl MongersREST::Neo4p - Talk @ DC Perl Mongers
REST::Neo4p - Talk @ DC Perl MongersMark Jensen
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav DukhinFwdays
 
Interview qutions
Interview qutionsInterview qutions
Interview qutionssatyaragha
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing TrainingVGlobal Govi
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with pythonHarry Potter
 

Similar to nHibernate Query (20)

Hibernate for Beginners
Hibernate for BeginnersHibernate for Beginners
Hibernate for Beginners
 
Advanced Hibernate Notes
Advanced Hibernate NotesAdvanced Hibernate Notes
Advanced Hibernate Notes
 
Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)Module 3: Introduction to LINQ (PowerPoint Slides)
Module 3: Introduction to LINQ (PowerPoint Slides)
 
Hibernate Interview Questions and Answers
Hibernate Interview Questions and AnswersHibernate Interview Questions and Answers
Hibernate Interview Questions and Answers
 
Bytebuf vs DirectByteBuffer
Bytebuf vs DirectByteBufferBytebuf vs DirectByteBuffer
Bytebuf vs DirectByteBuffer
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Hibernate jj
Hibernate jjHibernate jj
Hibernate jj
 
Qtp syllabus
Qtp syllabus Qtp syllabus
Qtp syllabus
 
Qtp stuff
Qtp stuffQtp stuff
Qtp stuff
 
Qtp basic stuff
Qtp basic stuffQtp basic stuff
Qtp basic stuff
 
Varnish Cache
Varnish CacheVarnish Cache
Varnish Cache
 
Java script performance tips
Java script performance tipsJava script performance tips
Java script performance tips
 
nHibernate Caching
nHibernate CachingnHibernate Caching
nHibernate Caching
 
Hibernate complete Training
Hibernate complete TrainingHibernate complete Training
Hibernate complete Training
 
REST::Neo4p - Talk @ DC Perl Mongers
REST::Neo4p - Talk @ DC Perl MongersREST::Neo4p - Talk @ DC Perl Mongers
REST::Neo4p - Talk @ DC Perl Mongers
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
Interview qutions
Interview qutionsInterview qutions
Interview qutions
 
QTP Faqs
QTP FaqsQTP Faqs
QTP Faqs
 
SAP Testing Training
SAP Testing TrainingSAP Testing Training
SAP Testing Training
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
 

More from Guo Albert

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorGuo Albert
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得Guo Albert
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置Guo Albert
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionGuo Albert
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study NotesGuo Albert
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsGuo Albert
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practiceGuo Albert
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date libraryGuo Albert
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errorsGuo Albert
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南Guo Albert
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableGuo Albert
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引Guo Albert
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟Guo Albert
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemGuo Albert
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReportsGuo Albert
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationGuo Albert
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectGuo Albert
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generationGuo Albert
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorialGuo Albert
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplateGuo Albert
 

More from Guo Albert (20)

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy Simulator
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @Version
 
OCEJPA Study Notes
OCEJPA Study NotesOCEJPA Study Notes
OCEJPA Study Notes
 
OCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation TipsOCEJPA(1Z0-898) Preparation Tips
OCEJPA(1Z0-898) Preparation Tips
 
JPA lifecycle events practice
JPA lifecycle events practiceJPA lifecycle events practice
JPA lifecycle events practice
 
XDate - a modern java-script date library
XDate -  a modern java-script date libraryXDate -  a modern java-script date library
XDate - a modern java-script date library
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errors
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History Table
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG System
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report Implementation
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy object
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generation
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorial
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
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
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 

nHibernate Query

  • 2. How nHibernation work? nHibernateQuery basic query Restriction String matcher Dynamic queries Subqueries Using Dynamic Institation Agenda 2
  • 3. How nHibernation work? Utilize session to manipulate VOs Criteria Session tables VOs VOs VOs Configuration SessionFactory VOs 3
  • 4. How nHibernation work? – cont. create update 4
  • 5. How nHibernation work? – cont. delete find 5
  • 6. nHibernate Query Criteria API Hibernate Query Language Object oriented querying Increase compile-time syntax-checking Easy to write Hard to read String-based querying Object-Oriented SQL Similar to SQL Speak in terms of objects Case sensitive Very flexible Zero compile-time syntax-checking 6
  • 7. Using the ICriteriainterface: ICriteriacriteria = session.CreateCriteria(typeof(Cases)); Generate SQL statement: select cases0_.caseId as caseId0_, cases0_.caseDesc as caseDesc0_, cases0_.caseTime as caseTime0_, cases0_.caseType as caseType0_, cases0_.caseAddr as caseAddr0_, cases0_.reporterStaff as reporter6_0_, cases0_.reporterPhone as reporter7_0_, cases0_.reporterAddr as reporter8_0_, cases0_.receiverStaff as receiver9_0_, cases0_.receiveTime as receive10_0_, cases0_.caseState as caseState0_, cases0_.updtDate as updtDate0_, cases0_.county as county0_, cases0_.town as town0_, cases0_.caseClass as caseClass0_ from Cases cases0_ nHibernate Query – basic query 7
  • 8. You usually don’t want to retrieve all instances of a class when you run a query. Instead, you want to express some constraints on the property values of your objects, so only a subset of objects is retrieved. This is called restriction. nHibernate Query – Restriction 8
  • 9. The like operator allows wildcard searches, where the wildcard symbols are % and _ nHibernate Query – String matcher 9
  • 10. It’s common for queries to be built programmatically by combining several optional query criteria depending on user input. nHibernate Query – Dynamic queries 10
  • 11. 11
  • 12. nHibernate Query – Subqueries 12
  • 13. If you find working with arrays of values a little cumbersome, NHibernate let’s you use dynamic instantiation and define a class to represent each row of results. You can do this using the HQL select new construct: The custom ItemRow class doesn’t have to be a persistent class that has its own mapping file. But in order for NHibernate to “see” it, you need to import it using nHibernate Query – Using Dynamic Institation 13
  • 14. Chapter 11. HQL: The Hibernate Query Language https://www.hibernate.org/hib_docs/nhibernate/html/queryhql.html NHibernate in Action http://www.manning.com/kuate/ Reference 14