3 options
NHibernate 4.x cookbook : over 90 incredible and powerful recipes to help you efficiently use NHibernate in your application / Gunnar Liljas, Alexander Zaytsev, Jason Dentler.
- Format:
- Book
- Author/Creator:
- Liljas, Gunnar, author.
- Zaytsev, Alexander, author.
- Dentler, Jason, author.
- Language:
- English
- Subjects (All):
- Hibernate (Electronic resource).
- Object-oriented programming (Computer science).
- Java (Computer program language).
- Physical Description:
- 1 online resource (449 pages) : illustrations
- Edition:
- Second edition.
- Place of Publication:
- Birmingham : Packt, 2017.
- System Details:
- text file
- Summary:
- Over 90 incredible and powerful recipes to help you efficiently use NHibernate in your application About This Book Master the full range of NHibernate features through detailed example recipes that you can quickly apply to your own applications Reduce hours of application development time and get a better application architecture and improved performance Create, maintain, and update your database structure automatically with the help of NHibernate Who This Book Is For This book is written for .NET developers who want to use NHibernate and those who want to deepen their knowledge of the platform. Examples are written in C# and XML. Some basic knowledge of SQL is assumed. If you build .NET applications that use relational databases, this book is for you. What You Will Learn Create a persistent object model to move data in and out of your database Build the database from your model automatically Configure NHibernate for use with WebForms, MVC, WPF, and WinForms applications Create database queries using a variety of methods Improve the performance of your applications using a variety of techniques Build an infrastructure for fast, easy, test-driven development of your data access layer Implement entity validation, auditing, full-text search, horizontal partitioning (sharding), and spatial queries using NHibernate Contrib projects In Detail NHibernate is a mature, flexible, scalable, and feature-complete open source project for data access. Although it sounds like an easy task to build and maintain database applications, it can be challenging to get beyond the basics and develop applications that meet your needs perfectly. NHibernate allows you to use plain SQL and stored procedures less and keep focus on your application logic instead. Learning the best practices for a NHibernate-based application will help you avoid problems and ensure that your project is a success. The book will take you from the absolute basics of NHibernate through to its most advanced features, showing you how to take full advantage of each concept to quickly create amazing database applications. You will learn several techniques for each of the four core NHibernate tasks - configuration, mapping, session and transaction management, and querying - and which techniques fit best with various types of applications. In short, you will be able to build an application using NHibernate by the end of the book. You will also learn how to best implement enterprise application archite...
- Contents:
- Cover
- Copyright
- Credits
- About the Authors
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Table of Contents
- Preface
- Chapter 1: The Configuration and Schema
- Introduction
- Installing NHibernate
- Configuring NHibernate with hibernate.cfg.xml
- Configuring NHibernate with App.config or Web.config
- Configuring NHibernate with code
- Configuring NHibernate with Fluent NHibernate
- Configuring NHibernate logging
- Generating the database
- Scripting the database
- Updating the database
- Using NHibernate schema tool
- Chapter 2: Models and Mappings
- Mapping a class with XML
- Creating class hierarchy mappings
- Creating class components
- Mapping a one-to-many relationship
- Mapping a many-to-many relationship
- Mapping collections of elements and components
- Setting up a base entity class
- Handling versioning and concurrency
- Mapping by code
- Mapping by convention
- Creating mappings fluently
- Bidirectional one-to-many class relationships
- Mapping enumerations
- Immutable entities
- Mapping relations to non-primary keys
- Using lazy properties
- Mapping joins
- Using calculated properties
- Using serializable values
- Dynamic components
- Mapping <
- subselect>
- Chapter 3: Sessions and Transactions
- Setting up session-per-web request
- Setting up session-per-presenter
- Creating a session ASP.NET MVC action filter
- Creating a transaction ASP.NET MVC action filter
- Save entities to the database
- Using session.Merge
- Using session.Refresh
- Handle concurrency using session.Lock
- Using dictionaries as entities
- Using NHibernate with transaction scope
- Chapter 4: Queries
- Query entities by ID
- Using LINQ to NHibernate
- Using CriteriaQueries
- Using QueryOver
- Using QueryOver projections and aggregates.
- Using the Hibernate Query Language
- Using native SQL
- Eager loading with LINQ
- Eager loading with Criteria
- Eager loading with QueryOver
- Eager loading with HQL
- Eager loading with SQL
- Using named queries
- Using detached queries
- Using HQL for bulk data changes
- Filtering collections
- Using result transformers
- Extra lazy collections
- Chapter 5: Improving Performance
- Reducing application startup time
- Using MultiCriteria
- Using MultiQuery
- Using Futures
- Eager loading child collections
- Using stateless sessions
- Using read-only entities
- Use the second-level cache
- Configuring the second-level cache with code
- Sharding databases for performance
- Chapter 6: Testing
- Using NHibernate Profiler
- Profiling NHibernate with Glimpse
- Fast testing with the SQLite in-memory database
- Preloading data with SQLite
- Using Fluent NHibernate persistence testing
- Using the Ghostbusters test
- Chapter 7: Data Access Layer
- Transaction auto-wrapping for the data access layer
- Setting up an NHibernate repository
- Using named queries in the data access layer
- Using ICriteria in the data access layer
- Using paged queries in the data access layer
- Using LINQ specifications in the data access layer
- Chapter 8: Extending NHibernate
- Creating an encrypted string type
- Creating a money type
- Using well-known instance types
- Using dependency injection with entities
- Creating an audit-event listener
- Creation and change stamping of entities
- Generating trigger-based auditing
- Implementing a soft-delete pattern
- Setting Microsoft SQL's Context_Info
- Using dynamic connection strings
- Using custom dialect functions
- Using custom functions in LINQ
- Extending the LINQ provider
- Chapter 9: NHibernate Contribution Projects.
- Introduction
- Property validation with attributes
- Creating validator classes
- Setting up full-text searches
- Auditing data with Envers
- Using NHibernate Spatial
- Index.
- Notes:
- Includes index.
- Description based on online resource; title from PDF title page (ebrary, viewed March 2, 2017).
- ISBN:
- 1-78439-411-4
- OCLC:
- 972900862
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.