From: NHibernate J. <mik...@us...> - 2006-11-13 18:03:30
|
[ http://jira.nhibernate.org/browse/NH-648?page=3Dall ] Sergey Koshcheyev reassigned NH-648: ------------------------------------ Assign To: Pierre Henri Kuat=C3=A9 > Discriminator attribute allowed for class (not only property, field or in= dexer) > -------------------------------------------------------------------------= ------ > > Key: NH-648 > URL: http://jira.nhibernate.org/browse/NH-648 > Project: NHibernate > Type: Improvement > Components: Contrib > Versions: 1.2.0.Alpha1 > Reporter: Christoph Wienands > Assignee: Pierre Henri Kuat=C3=A9 > Priority: Trivial > Fix For: LATER > > Hello Kpix, > I have another improvement request for you. I defined a base class Domain= Object, which already defines an ID (note that PascalCaseMUnderScore is a c= ustom FieldAccessor so I can use strong typing instead of strings): > =09public class DomainObjectInt : DomainObject<int> > =09{ > =09=09[Id(0, Name =3D "ID", Column =3D "ID", TypeType =3D typeof(Int32), = UnsavedValue =3D "0", > =09=09=09AccessType =3D typeof(PascalCaseMUnderScore))] > =09=09[Generator(1, Class =3D "identity")] > =09=09public override int ID > =09=09{ > =09=09=09get { return base.ID; } > =09=09} > =09} > Now when I want to define inheritance hierarchies I run into trouble: > =09[Class(0, NameType =3D typeof(Operation), Table =3D "[Operation]", Laz= y =3D false)] > =09[Discriminator(1, Column =3D "Discriminator")] > =09public abstract class Operation : DomainObjectInt, IOperation > =09{ > =09} > I'd like to place the discriminator right at the top with the class defin= ition. However, it's only valid on property, indexer or field. The workarou= nd is to place it e.g. on top of the first member variable but that's misle= ading when someone looks at the code. > Is there a reason why I couldn't place that attribute on top of the class= ? > Thanks, Christoph --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |