O'Reilly logo

NHibernate 3 Beginner's Guide by Gabriel N. Schenker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Wrong mapping for read-only access

Often we might need to access some data in read-only mode. This data can be denormalized and aggregated to, for example, produce a report on screen or on paper. In this case, we might want to use database views to retrieve the data and map data transfer objects (DTOs) to those views.

A typical sample would be retrieving a list of the top 10 customers of the month including the customer name, the number of orders, and the total value of the orders placed during the month of interest. Let's assume we have created a database view to collect all this data. The view is called Top10CustomersOfMonth and has the fields CustomerId, CustomerName, NbrOfOrders, Total, Month, and Year.

Let's also assume we have the DTO Top10Customers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required