Index
A
- ACID properties
- about / Transactions and unit of work
- Atomic / Transactions and unit of work
- Consistency / Transactions and unit of work
- Isolation / Transactions and unit of work
- Durability / Transactions and unit of work
- action filter
- using, of ASP.NET MVC / Using the action filters of ASP.NET MVC or Web API
- using, of Web API / Using the action filters of ASP.NET MVC or Web API
- ADO.NET batching
- used, for batching write queries / Batching the write queries using ADO.NET batching
- limitation / Limitations of batching
- memory consumption / Memory consumption and batching
- architectural principles
- about / Architectural principles we will follow
- anaemic domain model, defining / No anaemic domain model
- onion architecture / The onion architecture
- dependency inversion principle / Dependency inversion
- dependency inversion / Dependency inversion
- capabilities, declaring / Explicitly declaring the capabilities required
- unit of work, defining / Unit of work
- architecture diagram, NHibernate / The architecture diagram
- association, mappings
- about / Association
- one-to-many / One-to-many
- many-to-one / Many-to-one
- one-to-one / One-to-one
- many-to-many / Many-to-many
- associations
- mapping / Mapping associations
- one-to-many / Mapping associations, One-to-many association
- many-to-one / Mapping associations, Many-to-one association
- one-to-one / Mapping associations, One-to-one association
- many-to-many / Mapping associations, Many-to-many association
- and database tables / Associations and database tables
- attribute/property / Important NHibernate terminology
B
- baseline
- determining / Baseline and optimize
- batching
- about / Batching
- reading, with future queries / Read batching using future queries
- lazy collections / Batching lazy collections
- batching settings / Being aware of the select N+1 problem
- bidirectional associations
- about / Bidirectional associations and ownership
- ownership / Bidirectional associations and ownership
- ownership, in many-to-many associations / Ownership in many-to-many associations
- cascade / Inverse and cascade
- inverse / Inverse and cascade
- building blocks, NHibernate
- about / Building blocks of NHibernate
- mappings / Mappings
- configuration / Configuration
- Session object / Session
C
- cache
- session level cache / Caching
- query cache / Caching, Query cache
- second level cache / Caching, Second level cache
- caching
- about / Caching
- cascade attribute / One-to-many association
- cascade options
- none / Transitive persistence using cascade styles
- save-update / Transitive persistence using cascade styles
- delete / Transitive persistence using cascade styles
- delete-orphan / Transitive persistence using cascade styles
- all / Transitive persistence using cascade styles
- all-delete-orphan / Transitive persistence using cascade styles
- components / Components
- composability / Querying the workflow
- composite IDs
- about / Composite IDs
- composite foreign key / Composite foreign key
- concurrency control
- about / Concurrency control
- optimistic / Concurrency control
- pessimistic / Concurrency control
- configuration options
- about / Configuration options
- connection release mode / Connection release mode
- dialect / Dialect
- driver / Driver
- mappings / Mappings
- connection string / Connection string
- caching / Caching
- session context / Session context
- command timeout / Command timeout
- show SQL / Show SQL
- ConfORM / Mapping by code
- contextual sessions
- used, for implementing session per request / Implementing session per request using the contextual sessions
- criteria API
- about / Criteria API
- queries, filtering / Filtering the criteria queries
- CurrentSessionContext
- configuring / Configuring CurrentSessionContext
- custom DTOs
- using / Using custom DTOs
- right locations / Right place for DTOs
- conversion layer / The conversion layer
- using, downsides / Downsides of using custom DTOs
- lazy loading retention / Custom lazy loading retention
D
- data access layer
- optimizing / Organization of the chapter
- database scripts
- generating, from mappings / Generating the database scripts from mappings
- database creation script / The database creation script
- database update scripts / The database update scripts
- database schema, creating/updating automatically / Automatically create/update the database schema
- database views
- working with / Working with database views
- DbContextConfiguration class / NHibernate for users of Entity Framework
- Delete method / Saving entities – complex scenarios
- dependency inversion principle
- about / Dependency inversion
- URL / Dependency inversion
- detached entities
- updating / Updating the detached entities
- development setup
- about / The development setup
- development setup, tools
- Visual Studio 2013 / Visual Studio 2013
- SQL Server 2012 Express / SQL Server 2012 Express
- ReSharper / ReSharper
- NUnit / NUnit
- NuGet / NuGet
- SQLite / SQLite
- dirty checking / Transitive persistence using cascade styles
- Domain-driven Design (DDD)
- domain model
- about / The domain model
- Employee class / Employee
- Leave class / Leave
- SeasonTicketLoan class / SeasonTicketLoan
- SkillEnhancementAllowance class / SkillEnhancementAllowance
- domain services
- about / No anaemic domain model
E
- eager fetching
- about / Disabling laziness, Eager fetching, How do we fix the select N+1 problem?
- HQL / HQL
- criteria API / Criteria
- QueryOver / QueryOver
- LINQ / LINQ
- avoiding / Avoiding eager fetching
- future queries / Future queries to the rescue
- employee, onboarding
- defining / Feature 1 – onboarding an employee, Back to onboarding an employee
- repository pattern / Repository pattern
- repository, using / Where does the repository belong?
- employee details, updating
- about / Feature 2 – updating the details of an employee
- partial updates, versus full updates / Feature 2 – updating the details of an employee
- updating detached entities, versus updating persistent entities / Feature 2 – updating the details of an employee
- transitive persistence, using / Updates using transitive persistence, Why transitive persistence is better
- detached entities, updating / Updating the detached entities
- employees
- searching / Feature 3 – searching employees
- Employee to Benefit association / Bidirectional associations and ownership
- entities
- saving / Saving entities
- complex scenarios / Saving entities – complex scenarios
- entity / Important NHibernate terminology
- entity equality
- about / Entity equality
- importance / Why does equality matter?
- implementing / Implementing equality
- entity states
- about / Entity states
- transient / Entity states
- persistent / Entity states
- detached / Entity states
- Envers
- event system
- about / Event system
- event listener / Event listeners
- audit trail, adding for entities / Adding the audit trail for entities
- explicit transaction
- extra-lazy behavior
- used, for lazy collections / Using extra-lazy for lazy collections
- extra-lazy option
- used, for lazy collections / Using extra-lazy for lazy collections
F
- fetching strategy / Being aware of the select N+1 problem
- about / Fetching strategies
- select fetching / Select fetching
- join fetching / Join fetching
- subselect fetching / Subselect fetching
- right strategy, selecting / Choosing the right fetching strategy
- fluent configuration
- about / Fluent configuration
- fluent mapping
- about / Fluent mapping
- flush modes
- about / Flush modes
- Never / Flush modes
- Commit / Flush modes
- Always / Flush modes
- Auto / Flush modes
- FNH
- about / Fluent mapping, Fluent mapping a.k.a. Fluent NHibernate
- URL / Fluent mapping
- inheritance mappings / Inheritance mappings
- component mapping / Component mapping
- foreign key relationship / Associations and database tables
- future queries
- used, for reading batching / Read batching using future queries
G
- GitHub repository
- URL / What is NHibernate?
- Guid.comb generator / Guid.comb
H
- Hibernate Query Language (HQL)
- about / Hibernate Query Language
- parameter binding / Parameter binding
- hooks
- using, in global.ascx file / Using hooks in the global.ascx file
- HTTP module
- using / Using the HTTP module
I
- identifier generation
- identifiers
- entities, retrieving / Retrieving entities by identifiers
- Load<T>, using / Why use Load<T>?
- impedance mismatch / What is ORM?
- implementation, NHibernate
- operations / Contextual sessions
- implicit joins
- about / Implicit joins
- QueryOver joins / QueryOver joins explained
- implicit transaction
- inheritance mapping
- about / Mapping inheritance
- verifying, with unit tests / Unit tests to verify the inheritance mappings
- table per class hierarchy / Table per class hierarchy
- table per subclass / Table per subclass
- table per concrete class / Table per concrete class
- right strategy, selecting / Choosing the right inheritance mapping strategy
- inheritance mappings, FNH
- table per class hierarchy / Table per class hierarchy
- table per concrete class / Table per concrete class
- table per subclass / Table per subclass
- inner join / Different types of joins
- inverse / Updating associations on a persistent entity
- Inversion of Control (IoC)
- about / The onion architecture
- ISession interface / Entity states
J
- join mapping
- used, for loading data from multiple tables / Join-mapping to load data from multiple tables
- joins
- about / Joins
- inner join / Different types of joins
- outer join / Different types of joins
- types / Different types of joins
- implicit joins / Implicit joins
- outer joins / Outer joins
- theta style joins / Theta style joins
L
- Language-Integrated Query (LINQ) / What is NHibernate?
- lazy collections
- about / Lazy collections
- laziness, disabling / Disabling laziness
- behaviors / Different lazy behaviors
- batching / Batching lazy collections
- extra-lazy option, using / Using extra-lazy for lazy collections
- lazy loading
- about / Lazy loading
- lazy collections / Lazy collections
- single-ended lazy associations / Single-ended lazy associations
- properties / Lazy properties
- using / Why use lazy loading?
- gotchas / Lazy loading gotcha's
- lazy loading, gotchas
- open session / Keeping the session open
- N+1 problem / Being aware of the select N+1 problem
- using, with fetching strategy / Using lazy loading together with the right fetching strategy
- automatic properties, using / Using automatic properties
- learning approach, NHibernate / Explaining the approach used in learning NHibernate
- legacy database
- composite IDs / Composite IDs
- components / Components
- join mapping / Join-mapping to load data from multiple tables
- database views, working with / Working with database views
- subselect, using / Using subselect instead of views
- stored procedures, working with / Working with stored procedures
- custom DTOs, using / Using custom DTOs
- LINQ / LINQ
- log4net / Show SQL
- loquacious configuration
- about / Loquacious configuration
M
- many-to-many association / Many-to-many association
- many-to-one association
- about / Many-to-one association
- Map / Fluent mapping a.k.a. Fluent NHibernate
- mapping
- prerequisites / Mapping the prerequisites
- writing, mechanisms / Different mechanisms to write the mappings
- about / The mappings
- hibernate-mapping element / The mappings
- class element / The mappings, Class
- id element / The mappings
- property element / The mappings, Property
- Hibernate-mapping / Hibernate-mapping
- inheritance / Mapping inheritance
- components / Mapping components
- by code / Mapping by code
- mapping, by code
- about / Mapping by code
- map identifier / Identifier
- property mapping / Property
- association mappings / Association
- map components / Component
- inheritance / Inheritance
- for employee benefits domain / Complete mappings by code for the employee benefits domain
- mapping, mechanisms
- XML mappings / XML mappings
- fluent mappings / Fluent mapping
- by code / Mapping by code
- mapping inheritance, by code
- about / Inheritance
- table per class hierarchy / Table per class hierarchy
- table per subclass / Table per subclass
- table per concrete class / Table per concrete class
- mappings
- about / Mappings
- programmatic configuration / Programmatic configuration
- fluent configuration / Fluent configuration
- Merge method / Saving entities – complex scenarios
- MultiQuery / Read batching using future queries
N
- N+1 problem / Being aware of the select N+1 problem
- native SQL
- about / Native SQL
- benefits / Native SQL
- NHibernate
- about / What is NHibernate?
- URL / What is NHibernate?, Mapping components, Show SQL, Parameter binding, Filtering the criteria queries
- for Entity Framework users / NHibernate for users of Entity Framework
- comparing, with Entity Framework / NHibernate for users of Entity Framework
- building blocks / Building blocks of NHibernate
- learning approach / Explaining the approach used in learning NHibernate
- Plain Old CLR Object (POCO) / Important NHibernate terminology
- identifier generation / Identifier generation
- defining / Warming up NHibernate succinctly
- session architecture / The NHibernate session architecture
- architecture diagram / The architecture diagram
- NHibernate 4.0
- about / What is new in NHibernate 4.0?
- NHibernate JIRA board
- URL / What is NHibernate?
- NHProfiler
- URL / Baseline and optimize
- non-functional features, data access layer
- logging / Non-functional features required by the data access layer
- caching / Non-functional features required by the data access layer
- connection management / Non-functional features required by the data access layer
- transaction management / Non-functional features required by the data access layer
- concurrency management / Non-functional features required by the data access layer
- lazy loading / Non-functional features required by the data access layer
- security / Non-functional features required by the data access layer
- batching of queries / Non-functional features required by the data access layer
- NuGet
- NuGet packages
- adding, to projects / Adding the NuGet packages to projects
- NUnit
- about / NUnit, Back to our test
- test, example / Back to our test
- NUnit GUI runner
- URL / NUnit
O
- Object-oriented Analysis and Design (OOAD)
- one-to-many association
- about / One-to-many association
- collection, types / Types of collections
- one-to-one association / One-to-one association
- onion architecture
- about / The onion architecture
- URL / The onion architecture
- defining / The onion architecture
- onion architecture, problems
- about / The onion architecture
- tight coupling / The onion architecture
- domain layer / The onion architecture
- optimistic-lock / Using optimistic-lock
- optimistic concurrency control
- about / Optimistic concurrency control
- optimistic-lock, using / Using optimistic-lock
- version property, using / Using the version property
- order of operations / Order of operations
- ORM
- about / What is ORM?
- using, disadvantages / Is using ORM a bad idea?
- using / Why ORM is a better bet?
- non-functional features, by data access layer / Non-functional features required by the data access layer
- outer join
- about / Different types of joins
- left outer join / Different types of joins
- right outer join / Different types of joins
- full outer join / Different types of joins
P
- pagination
- persistent class / Important NHibernate terminology
- Persist method / Saving entities – complex scenarios
- pessimistic concurrency control
- about / Concurrency control, Pessimistic concurrency control
- write lock mode / Pessimistic concurrency control
- Upgrade mode / Pessimistic concurrency control
- UpgradeNoWait mode / Pessimistic concurrency control
- none lock mode / Pessimistic concurrency control
- polymorphic queries
- about / Polymorphic queries
- problem statement
- about / The problem statement
- problems with repository pattern
- about / Problems with the repository pattern
- generalization / Generalization
- confusing contract / Unclear and confusing contract
- unclear contract / Unclear and confusing contract
- leaky abstraction / Leaky abstraction
- god object anti-pattern / God object anti-pattern
- programmatic configuration
- about / Programmatic configuration
- programmatic configuration, mappings
- XML mapping / XML mapping
- mapping by code / Mapping by code
- projects
- code, adding / Adding some code
- NuGet packages, adding to / Adding the NuGet packages to projects
Q
- query
- records returned count, narrowing / Narrowing down the number of records returned by a query
- query cache
- about / Query cache
- querying
- workflow / Querying the workflow
- querying methods
- about / Different querying methods
- native SQL / Native SQL
- Hibernate Query Language (HQL) / Hibernate Query Language
- criteria API / Criteria API
- QueryOver API / The QueryOver API
- LINQ / LINQ
- selecting / Which querying method should I use?
- query object pattern
- about / Query object pattern
- extending / Extending the query object pattern
- limitations / The limitations of the query object pattern
- QueryOver API / The QueryOver API
- QueryOver joins
- about / QueryOver joins explained
- JoinAlias / JoinAlias
R
- Refresh method / Saving entities – complex scenarios
- Repository<T> class
- repository pattern
- ReSharper
- results
- right mapping method
- selecting / Choosing the right mapping method
- RoundHouse
S
- SaveOrUpdate method / Saving entities – complex scenarios
- SchemaExecute
- SchemaUpdate
- second level cache
- about / Second level cache
- read only / Second level cache
- read write / Second level cache
- non-strict read write / Second level cache
- select N+1 problem
- avoiding / Avoiding the select N+1 problem
- about / What is the select N+1 problem?
- selecting, reasons / Why select N+1 is a problem?
- fixing, methods / How do we fix the select N+1 problem?
- select N+1 problem, fixing
- eager fetching / How do we fix the select N+1 problem?
- fetching strategies / How do we fix the select N+1 problem?
- batching / How do we fix the select N+1 problem?
- extra lazy option / How do we fix the select N+1 problem?
- caching / How do we fix the select N+1 problem?
- session architecture, NHibernate
- about / The NHibernate session architecture
- Data Access Layer / The NHibernate session architecture
- Configuration / The NHibernate session architecture
- Database / The NHibernate session architecture
- Session Factory / The NHibernate session architecture
- session level cache
- about / Session level cache
- session per request
- defining / Session per request
- implementing, contextual sessions used / Implementing session per request using the contextual sessions
- HTTP module, using / Using the HTTP module
- hooks, used in global.ascx file / Using hooks in the global.ascx file
- action filter, used of ASP.NET MVC / Using the action filters of ASP.NET MVC or Web API
- action filter, used of Web API / Using the action filters of ASP.NET MVC or Web API
- WCF / WCF
- single-ended lazy associations
- about / Single-ended lazy associations
- Proxy, versus NoProxy / Proxy versus NoProxy
- single responsibility principle (SRP) / God object anti-pattern
- software
- optimizing / Baseline and optimize
- specification pattern
- about / Specification pattern
- in original form / Specification pattern in its original form
- for NHibernate / Specification pattern for NHibernate
- chaining / Specification chaining
- limitations / Limitations
- SQL injection attack / Parameter binding
- SQLite
- about / SQLite
- SQL Server 2012 Express
- about / SQL Server 2012 Express
- URL / SQL Server 2012 Express
- stateless sessions
- using / Stateless sessions
- storage mechanism
- CallSessionContext / Configuring CurrentSessionContext
- ThreadStaticSessionContext / Configuring CurrentSessionContext
- WcfOperationSessionContext / Configuring CurrentSessionContext
- stored procedures
- working with / Working with stored procedures
- named queries / Working with stored procedures
- subselect
- using, instead of views / Using subselect instead of views
- table synchronization / Using subselect instead of views
- mapping ID / Using subselect instead of views
- mapping properties / Using subselect instead of views
T
- theta style joins / Theta style joins
- transaction
- about / Transactions and unit of work
- explicit transaction / Explicit and implicit transactions
- implicit transaction / Explicit and implicit transactions
- transitive persistence
- implementing, cascade styles used / Transitive persistence using cascade styles
- used, for updates / Updates using transitive persistence
- transitive persistence/cascading
- implementing / Transitive persistence/cascading in action
- transient entity, saving with association to other transient entities / Saving a transient entity with association to other transient entities
- bidirectional associations / A word on bidirectional associations
- associations, updating on persistent entity / Updating associations on a persistent entity
- persistent entity, deleting / Deleting a persistent entity with one or more associations set
U
- unit of work
- about / Transactions and unit of work, Unit of work
- defining / Unit of work
- scope, for web applications / Scope of unit of work for web applications
- session per request / Session per request
- contextual sessions / Contextual sessions
- CurrentSessionContext, configuring / Configuring CurrentSessionContext
- spanning whole HTTP request / Unit of work spanning the whole HTTP request
- with custom scope / Unit of work with custom scope
- unit of work implementation
- about / Unit of work implementation
- Update method / Saving entities – complex scenarios
- user-defined types
- about / User-defined types
- NullSafeGet method / User-defined types
- NullSafeSet method / User-defined types
- DeepCopy method / User-defined types
- Replace method / User-defined types
- Assemble method / User-defined types
- Disassemble method / User-defined types
- SqlTypes method / User-defined types
- ReturnedType method / User-defined types
- IsMutable method / User-defined types
- ICompositeUserType / Other user-defined types
- IUserCollectionType / Other user-defined types
- IEnhancedUserType / Other user-defined types
- IParameterizedUserType / Other user-defined types
- ILoggableUserType / Other user-defined types
- IUserVersionType / Other user-defined types
V
- Visual Studio 2013
- about / Visual Studio 2013
W
- WCF
- about / WCF
- web application
- building / What kind of application are we building?
- workflow
- querying / Querying the workflow
- write queries
- batching, with ADO.NET batching / Batching the write queries using ADO.NET batching
X
- XML configuration
- about / XML configuration
- XML mappings
- about / XML mappings
- for Employee class / XML mappings for the Employee class
- XML mappings, Employee class
- about / XML mappings for the Employee class
- development environment, creating / Getting the development environment ready
- working, with IntelliSense / Getting IntelliSense to work with the XML mapping files
- mappings, verifying with unit tests / Unit tests to verify the Employee mappings
- mappings / The mappings