
NHibernate 3 Beginner's Guide.
Title:
NHibernate 3 Beginner's Guide.
Author:
Schenker, Gabriel Nicolas.
ISBN:
9781849516037
Personal Author:
Edition:
1st ed.
Physical Description:
1 online resource (447 pages)
Contents:
NHibernate 3 Beginner's Guide -- Table of Contents -- NHibernate 3 Beginner's Guide -- Credits -- About the Authors -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Time for action - heading -- What just happened? -- Pop quiz - heading -- Have a go hero - heading -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. First Look -- What is NHibernate -- What is new in NHibernate 3.0 -- Why would I use it -- Where do I get it -- Is there documentation available -- Can I get help using NHibernate -- Is there commercial support available -- Who uses it -- Summary -- 2. A First Complete Sample -- Prepare our development environment -- Defining a model -- Time for action - Creating the product inventory model -- What just happened? -- Mapping our model -- Time for action - Creating the mapping classes -- What just happened? -- Creating the database schema -- Time for action - Creating the database -- What just happened? -- Creating a session factory -- Time for action - Creating a session factory -- What just happened? -- Opening a session -- Time for action - Opening a session to the database -- What just happened? -- Persisting objects to the database -- Time for action - Adding a new category to the database -- What just happened? -- Reading from the database -- Time for action - Loading the list of all categories from the database -- What just happened? -- Have a go hero -- Doing the same without NHibernate - using ADO.NET only -- Pop quiz -- Summary -- 3. Creating a Model -- What is a model -- Model first versus data first -- Elements of a model -- Entity -- Value object.
Time for action - Creating a Name value object -- What just happened? -- Creating an entity -- Time for action - Creating a base entity -- What just happened? -- Time for action - Creating a Customer entity -- What just happened? -- Defining relations between entities -- Owns or contains -- One-to-many -- One-to-one -- Many-to-many -- The order entry model -- Time for action - Implementing an order entry model -- What just happened? -- Pop quiz - Identifying entities -- Have a go hero - Extending the model -- Summary -- 4. Defining the Database Schema -- What is a database schema? -- Who owns the database? -- Time for action - Creating the OrderingSystem database -- What just happened? -- Laying the foundation - table layouts -- Time for action - Creating the Categories table -- What just happened? -- Time for action - Defining a script to create the Products table -- What just happened? -- Table columns -- Data types of table columns -- Relations, constraints, and indices -- Relations -- Constraints -- Time for action - Adding a constraint to the Product table -- What just happened? -- Time for action - Creating a script to add a check constraint -- What just happened? -- Indices -- Time for action - Adding an index using the designer -- What just happened? -- Time for action - Creating a script to add an index -- What just happened? -- Normal form -- Putting it all together -- Time for action - Creating a schema for the order entry system -- What just happened? -- Have a go hero - Adding an additional table to the schema -- Have a go hero - Authoring a DDL script to generate the schema -- Do not use database-generated IDs -- Views -- What about stored procedures and triggers? -- Pop quiz -- Summary -- 5. Mapping the Model to the Database -- What is mapping? -- Types of mapping -- XML-based mapping -- Attribute-based mapping -- Fluent mapping.
Mapping by convention -- A word about lazy loading -- Loading data on demand -- Proxies -- Virtual properties and methods -- Creating database schema creation scripts -- Fluent mapping -- Expression trees - please explain -- Getting started -- Classes -- Entity level settings -- ID columns -- Properties -- References -- Collections -- Mapping many-to-many relations -- Mapping value objects -- Time for action - Mapping our domain -- What just happened? -- Use mapping conventions -- ID conventions -- Property conventions -- Foreign key conventions -- Have a go hero - Implement your own convention -- No mapping -- is that possible? -- Auto-mapping with Fluent NHibernate -- Time for action - Using auto-mapping -- What just happened? -- Using ConfORM -- Time for action - Using ConfORM to map our domain -- What just happened? -- XML mapping -- Getting started -- Classes -- Properties -- ID columns -- One-to-many relations -- Many-to-many relations -- Mapping value objects -- Time for action - Mapping a simple domain using XML -- What just happened? -- Pop quiz - XML mapping -- Summary -- 6. Sessions and Transactions -- What are sessions and transactions -- Session -- Transaction -- The session factory -- Creating your first session -- Why do we call Commit? -- Adding new data to the database -- Reading data from the database -- Get versus Load -- Updating existing data -- Deleting data -- First level cache or identity map -- Clearing the cache -- Refreshing entities in the cache -- No database operation without a transaction -- Should I use transactions when querying data? -- NHibernate session versus database session -- Time for action - Creating a session and doing some CRUD -- What just happened? -- Pop quiz - Creating, updating, and deleting data -- Session management -- Web-based applications.
Time for action -Implementing session management for a web application -- What just happened? -- WinForm or WPF applications -- Windows services -- Unit of Work -- Handling exception -- Second level cache -- Cache regions -- Second level cache implementations -- Time for action - Using a second level cache -- What just happened? -- Summary -- 7. Testing, Profiling, Monitoring, and Logging -- Why do we need tests? -- What should we test? -- What about the database? -- Download SQLite -- Pop quiz -- Preparing our environment for testing -- Testing the mapping -- Testing the mapping with Fluent NHibernate -- Time for action - Creating the base for testing -- What just happened? -- Have a go hero -- Time for action - Using SQLite in our tests -- What just happened? -- Testing queries -- Logging -- Why do we need to log? -- Logging with Log4Net -- Time for action - Adding logging to our application -- What just happened? -- Setting up logging for NHibernate -- Time for action - Enable logging in NHibernate -- What just happened? -- Monitoring and profiling -- Analyzing log files -- Using SQL Server Profiler -- Monitoring and profiling with NHibernate Profiler -- Time for action - Adding NHibernate Profiler support -- What just happened? -- Summary -- 8. Configuration -- Why do we need a configuration? -- Elements of the configuration -- Which database do we want to use? -- What byte code provider and proxy factory? -- Where are our mappings? -- Do we use second level caching? -- Do we want to extend NHibernate? -- XML configuration -- Time for action - Configuring NHibernate using XML -- What just happened? -- Configuring NHibernate in code -- Time for action - Configuring NHibernate in code -- What just happened? -- Fluent configuration -- Configuring NHibernate with Loquacious -- Time for action - Using Loquacious to configure NHibernate.
What just happened? -- Pop quiz -- Configuring NHibernate with Fluent NHibernate -- Have a go hero -- Convention over configuration -- Summary -- 9. Writing Queries -- How can we get to our data? -- The LINQ to NHibernate provider -- Defining the root of our query -- Limiting the number of records returned -- Filtering a set of records -- Mapping a set of records -- Sorting the resulting set -- Grouping records -- Forcing a LINQ query to execute immediately -- Changing from querying the database to querying in-memory objects -- Creating a report using LINQ to NHibernate -- Time for action - Preparing the system -- What just happened? -- Time for action - Creating the reports -- What just happened? -- Criteria queries -- Untyped criteria queries -- Strongly-typed criteria queries -- Time for action - Using QueryOver to retrieve data -- What just happened? -- Have a go hero -- Hibernate Query Language -- Lazy loading properties -- Have a go hero -- Executing multiple queries in a batch -- Eager loading versus lazy loading -- Bulk data changes -- Pop quiz - Some remarkable points -- Summary -- 10. Validating the Data to Persist -- What is validation and why is it so important? -- Who owns the database? -- Why, what, and where do we validate? -- Why validate? -- What data? -- Where to validate? -- Validating single properties -- Configuring the validator -- Defining validation rules -- Fluently configure validation rules -- Enforcing validation -- Time for action - Using property validation -- What just happened? -- Have a go hero -- Validating complex business rules -- Enforcing always valid entities -- Using validation classes -- Time for action - Validating user input -- What just happened? -- Have a go hero -- What to do if we don't own the database? -- Pop quiz -- Summary -- 11. Common Pitfalls-Things to Avoid -- Requesting the obvious.
Wrong mapping for read-only access.
Abstract:
Rapidly retrieve data from your database into .NET objects.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Genre:
Added Author:
Electronic Access:
Click to View