-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem on using Maps on AS/400 (iSeries)
PostPosted: Mon Feb 27, 2006 10:04 am 
Regular
Regular

Joined: Mon Jun 13, 2005 12:21 pm
Posts: 61
Location: Hannover
Hi,

I've got a pretty strange problem using Maps on DB2400Dialect.

I've got a very simple component mapping:
Code:

   <class name="ArticleImpl" table="V30">
                 <id name="articleNo" type="java.lang.String" column="V300010">
         <generator class="assigned" />
      </id>

               ...
      <map name="articleNames" table="V30_01">
         <key column="V3001_001" not-null="true"/>
         <map-key column="V3001_002" type="java.lang.String" length="3"></map-key>
         <element column="V3001_003" length="30" type="string"></element >
      </map>


Mapping Article to different article names (in different languages). This works fine as long as the my primary key column has the full length (of 7 chars). But I also got some article which have have only 5 chars (on both tables).
Cause of some pretty strange handling of the AS/400 Driver/Dialect the properties seems to be filled up with blanks (Article "12345" becomes "12345 "). So the HashMap handling seems to get into problems and my articleNames Map is always empty.
The problem only occurs on iSeries maschines and only with articleNo whos article Names are filled up.

Any ideas or solutions to get the articleNames filled?
Joerg

Hibernate version: 3.05


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 3:05 pm 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
You can trim map keys using an homemade UserType :
http://www.hibernate.org/90.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.