-->
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.  [ 3 posts ] 
Author Message
 Post subject: map a view
PostPosted: Tue Jan 16, 2007 10:36 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
Hi all,

I just would like to know how to map a view. i have a class Group a which mapping file is:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="ArchivecoFramework" assembly="ArchivecoFramework">
  <class name="Groupe" table="V_GROUPE">
    <id name="NomGroupe">
      <column name="GROUPE"/>
      <generator class="assigned"/>
    </id>
    <set name="Clients" lazy="true">
      <key column="GROUPE"/>
      <one-to-many class="Client"/>
    </set>
  </class>
</hibernate-mapping>


V_GROUPE is the view i would like to use but i always have the message:

"Invalid mapping information specified for type ArchivecoFramework.Groupe, check your mapping file for property type mismatches."

Moreover, if i compile again, i have the results that i expect to.

Thank you for answer me quickly !!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 17, 2007 6:18 am 
Newbie

Joined: Mon Jan 15, 2007 10:09 am
Posts: 12
I found the solution : I had to put "bag" instead of "set" for my one-to-many relation block.

Could someone explain me the difference between set and bag ????


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 30, 2007 2:32 pm 
Newbie

Joined: Wed May 16, 2007 7:39 am
Posts: 5
>Could someone explain me the difference between set and bag ????

set cannot accomodate duplicate entries in it where as bag can have duplicates.

set uses the NHibernate specific datatype Iesi.collections.Iset in the entity file where as bag used .NET native type IList.

set performance is found to be better when one-to-many relationships where as Large NHibernate bags mapped with inverse="false" are inefficient and should be avoided. NHibernate can't create, delete or update rows individually, because there is no key that may be used to identify an individual row.


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

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.