I'm mapping a view using ActiveRecord, which means I need a primary key. I don't have one, so I'm using ROW_NUMBER() to create one in the view definition to placate the system. However, I don't seem to know how to map it properly. I'm getting:
Could not find field 'stupidID' in class 'blah_blah'
NHibernate.PropertyNotFoundException: Could not find field 'stupidID' in class 'blah_blah'
My mapping looks like this. There is no
public long? stupidID;
[PrimaryKey("StupidId", Access = PropertyAccess.NosetterLowercaseUnderscore)]
public long? StupidId
{
get { return stupidID; }
}
Can anyone see what I'm missing?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…