-->
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: NHibertion Collection laden
PostPosted: Thu Aug 18, 2011 6:37 am 
Newbie

Joined: Thu Aug 18, 2011 6:29 am
Posts: 1
Hallo,

habe in einer Datenbank 2 Tabellen Infos über UserDefaults. In der einen stehen globale Default werte, falls der User keinen eigenen Wert festgelegt hat.
In der anderen ein Verweis auf den Default wert und der user-Wert.

Diese wollte ich jetzt über eine sql-query mappen:

Code:

    <bag name="UserDefaults">
      <key column ="idPersonal" />
      <one-to-many class="UserConfig"  />
      <loader query-ref ="sqlDefaults"/>
    </bag>

  </class>
  <sql-query name="sqlDefaults">   
    <load-collection alias="UserDefaults" role ="Personal.Defaults" />
    SELECT * FROM v_cfg_UserDefaults where idPersonal = ? or idPersonal is null
  </sql-query>
</hibernate-mapping>


Funktioniert soweit, nur werden leider die Zeilen, die einen NULL-Wert in idPersonal haben nicht gemappt...

Ist das "by-design", mache ich etwas falsche, oder gibt es einen Workaround?

Thx

Bernhard


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.