interface - Persisting one table per class hierarchy using NHibernate without discriminator? -


i have interface , class implements interface.

public interface iphase {     string description { get; set; }     int id { get; }     string phase { get; set; } }  public class phase : iphase {     // implementation here... } 

now, using nhibernate 2.1.2.ga, wish use table-per-class-hierarchy map interface , implementor, , indeed, don't need discriminator, implementor class persisted in table. haven't used nhibernate year , half now, , i'm suffering memory blanks here...

i have read question , answers related, except i'm not using fnh.
nhibernate mapping: save hierarchy single table without discriminator

  1. i wonder whether discriminator attribute obligatory while using subclass?

  2. what shall xml mapping in particular context?

thanks kindly help!

of course nhibernate needs discriminator table-per-class-hierarchy mapping, how should identify different subclasses when getting row database otherwise?

if there 1 implementation of interface, why want map it? map class normal entity (without inheritance).

edit: forgot might have references interface in mapping. in case try table-per-concrete-class mapping marking base class (interface) abstract="true" described here: http://nhibernate.info/doc/nh/en/index.html#inheritance-tableperconcrete


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -