Fluent NHibernate: Example of a one-to-many relationship on an abstract class of a table-per-subclass implementation -


itemprop = "text">

An example I'm trying to age (because I can not find it to work for myself) Right < / P>

One example below: I am looking to map the list of penalties on loan. I'm mapping for one-to-many relationships on a table.

If anybody knows about any tutorials or examples, please let me know.

  Public Intangible Square Unit {Public Entity ID {Receipt; Set; }} Public abstract class loan: unit {public decimal balance {received; Set; } Public IList & lt; OK & gt; Penalty (Received); Set; } Public Debt () {Penalties = New list & lt; OK & gt; (); }} Public Class CarLoan: Credit {} Public Sector Credit Card: Loan {} Public Loan Loan Application: Entity {Public IList & lt; Loans & gt; Existing Debas {Get; Set; } Public Loan Application () {Existing Debates = New List & lt; Loans & gt; (); }} Public class ok {public int64 cash} {get; Set; }}  

Can you tell us why you really have trouble? What have you tried?

Obviously, you have to declare all your members virtual (I think this was an inspection in the example).

Actually, however, it will look like this:

  Public Datmap: Classmaker & lt; Loans & gt; {PUBLIC DATMAPP () {ID (X = & gt; x.Id); HasMany (x = & gt; x.Fines); }} Public Finemap: Classmap & lt; OK & gt; {Public Finnmark () {ID (x => x.Id); // Map for other members}} Public CarLoanMap: subclassMap & lt; CarLoan & gt; {} Public credit cardmap: subclass map & lt; Credit Card & gt; {}  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -