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