Would it work to set all columns as composite key?

--
Mohamed Meligy
Senior Developer (Microsoft Technologies - Technical Delivery)
Injazat Data Systems
P.O. Box: 8230 Abu Dhabi, UAE.

Direct:  +971   2 4045385
Mobile: +971 50 2623624, +971 55 2017 621

E-mail: eng.mel...@gmail.com
Weblog: http://gurustop.net


On Tue, Jun 1, 2010 at 3:13 PM, Chris C <chilve...@googlemail.com> wrote:

> NHibernate always requires a unique key of some kind when mapping
> tables/views to entities.
>
> On May 28, 7:53 am, Stig <stig.christen...@gmail.com> wrote:
> > 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");
> >     }
> >
> >
> >
> > }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To post to this group, send email to fluent-nhibern...@googlegroups.com.
> To unsubscribe from this group, send email to
> fluent-nhibernate+unsubscr...@googlegroups.com<fluent-nhibernate%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to fluent-nhibern...@googlegroups.com.
To unsubscribe from this group, send email to 
fluent-nhibernate+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en.

Reply via email to