views:

49

answers:

0

Hi,

I wonder if this is possible to map the following with fluent nhibernate:

A document table and a document_revision table will be the target tables.

The document_revision table should have a composite unique key consisting of the document_id and the revision number (where the document_id is also the foreign key to the document table).

class Document
{
    Guid Id;
    //other members omitted
}

class DocumentRevision
{
    Guid document_id; //Part one of the primary key and also foreign key to Document.Id
    int revision; //Part two of the primary key
    //other members omitted
}

related questions