KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to map a view without an identifier, but nhibernate still generates a sql with the id column (giving me a sql error, since the ID column does not exists in the db). Maybe I'm misunderstanding the Id() constructor? constructor comments: Create an Id that doesn't have a corresponding property in the domain object, or a column in the database. This is mainly for use with read-only access and/or views. Defaults to an int identity with an "increment" generator. public class PersonMapping : ClassMap<Person> { public PersonMapping() { Table("person"); ReadOnly(); Id(); Map(f => f.Name, "name"); } }
Tags (comma-separated)
Save Edits
Cancel