-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Abstract, generics, subclass and attributes
PostPosted: Thu Jun 11, 2009 9:48 am 
Newbie

Joined: Thu Oct 23, 2008 10:00 am
Posts: 3
Hi,

I have an interface, an abstract implementation of interface with generics and a concrete implementation.

eg.
Code:
interface IProperty

[Class(Table = "Properties", Lazy = false)]
abstract AbstractGenericProperty<T> : IProperty

[Subclass(ExtendsType = typeof(AbstractGenericProperty<string>), DiscriminatorValue = "string", Lazy = false)]
class StringProperty : AbstractGenericProperty<string>


When I run it I get...
Code:
NHibernate.MappingException: These classes referenced by 'extends' were not found:
NhibernateTest.AbstractGenericProperty`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], PromoNhibernateTest


And here's the generated mapping
Code:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated from NHibernate.Mapping.Attributes on 2009-06-11 14:48:11Z.-->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <class name="NhibernateTest.AbstractGenericProperty`1, PromoNhibernateTest" lazy="false" table="Properties">
    <id>
      <generator class="identity" />
    </id>
    <discriminator column="Name" type="String" />
  </class>
  <subclass name="NhibernateTest.StringProperty, PromoNhibernateTest" lazy="false" extends="NhibernateTest.AbstractGenericProperty`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], PromoNhibernateTest" discriminator-value="string" />
</hibernate-mapping>


Can anyone help??


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.