-->
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: Import a "result" class with NHibernate Mapping At
PostPosted: Mon Feb 12, 2007 11:08 am 
Newbie

Joined: Wed Dec 20, 2006 9:00 am
Posts: 10
Location: Brazil (GMT-3)
Hi!

I'm trying to map a "result" class to be used in a SQL statement (not HQL, that is, I'm using CreateSQLQuery) using NHibernate mapping attributes, but I had no success so far. Previously, using XML files I used the <import> inside a <hibernate-mapping>, like this:

Code:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="srvengine">
 
    <import class="lcslink.ServerEngine.AlarmValue, srvengine"/>
 
    <joined-subclass name="lcslink.ServerEngine.AlarmSample" lazy="true" table="event_sample"  extends="lcslink.ServerEngine.Sample">
      <key column="oid" />
      <property name="Active" column="active" not-null="true" />
      <property name="DownTimestamp" column="down_timestamp" not-null="true" />
      <property name="AcknowledgedTimestamp" column="acknowledged_timestamp" not-null="true" />
      <property name="AcknowledgedFlag" column="ack_flag" not-null="true" />

      <many-to-one name="User" column="login_id" not-null="false" />
     
    </joined-subclass>
</hibernate-mapping>




I thought that when using mapping attributes, it would be just a matter of adding an Import to a class like this:

Code:

   <Import()> _
    Public Class Item
        Public Value As String
        Public MeasureQuality As String
    End Class



But the attribute must be attached to a Field or Property... What am I missing here?

Has anyone done this? :-)

Thanks for any help!

NHibernate.Mapping.Attributes version: 1.0.2.0

_________________
If a post helps you, rate it!


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.