Mapping properties from a foreign table twice in Fluent NHibernate?

I don't think you would be able to Insert/Update anymore if you were to only reference the Name.

I don't think you would be able to Insert/Update anymore if you were to only reference the Name. You could create a view of PenColour or hide the actual reference in your pen class and only expose the Name property.

Ok, I get it. Basically, another class (e.g. PenColor) is needed acting as a view for read-only purpose, and in order by have update and insert possible, the Pen object still need to refer to Color objects, (which is not too bad, but that's kind of an abstraction leak), right? – Weiming Nov 3 '10 at 2:55 One question: when you say a "view" of PenColor, do you mean a database view, or a class?

– Weiming Nov 3 '10 at 3:29.

Class Pen { int PenID; Color PrimaryColor; Color SecondaryColor; } class Color { int ColorID; string ColorName; } class ColorMap { Id(x => x. ColorID); Map(x => x. ColorName); } class PenMap { Id(x => x.

PenID); References(x => x. PrimaryColor). Column("TP_PrimaryColorID"); References(x => x.

SecondaryColor). Column("TP_SecondaryColorID"); }.

– Weiming Oct 28 '10 at 22:09 yes, you can create a view which contains two varchar columns PrimaryColorName and SecondaryColorName. The limitation is that you won't be able to update or insert. – tonyjy Oct 29 '10 at 18:48 Thanks!

I think user456813 gave the same answer. – Weiming Nov 3 '10 at 2:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions