-->
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: Problems with a simple Map
PostPosted: Mon Sep 29, 2003 12:28 pm 
Newbie

Joined: Mon Sep 29, 2003 12:21 pm
Posts: 4
Hi,

I've tested a fairly simple Map today (hibernate2 with xdoclett) but it doesn't work .

The Data Object is like this

Code:
private Map _map;
/**
* @hibernate.map  table = "DMap"
* @hibernate.collection-key column = "ID"
* @hibernate.collection-index column = "mKey" type = "string" = "50"
* @hibernate.collection-element column = "mValue" type = "string"

*/
   public Map getMap() {
      return _map;
   }
   public void setMap(Map an_map) {
      _map = an_map;
   }


And the Mapping xml is like this :

Code:
<map
            role="map"
            table="DMap"
            lazy="false"
            sort="unsorted"
            cascade="none"
        >

              <key
                  column="ID"
              />

              <index
                  column="mKey"
                  type="string"
                  length="50"
              />

              <element
                  column="mValue"
                  type="string"
                  length="1000"
                  not-null="false"
                  unique="false"
              />

        </map>


The schema generations works as expected. I got one extra table for the mapping but I wasn't able to do anything godd with this table.

My Client Code failed while setting up the ConfigurationObject. I got the following Exception
Quote:
net.sf.hibernate.PropertyNotFoundException: Could not find a getter for null in class de.ivent.jdo.Detail


Everything is fine without the Map. Is there anything I missed ? (The code and the mapping.xml looks pretty much like the example in the reference.pdf.


Code:
Configuration cfg = new Configuration().addClass(Detail.class);
         Session s = cfg.buildSessionFactory().openSession();
         Transaction t = s.beginTransaction();
         Detail d = new Detail();
         s.save(d);
         t.commit();



Kind Regards Stefan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 12:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Your mapping does not validate against hibernate-mapping-2.0.dtd!


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.