-->
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: Map in another Map - how must the mapping file look like?
PostPosted: Sun Mar 11, 2007 10:56 am 
Newbie

Joined: Sat Mar 10, 2007 6:20 pm
Posts: 2
Hi,
i have already written in the german forum, but i don´t know whether i get there an answer, so i want to ask here.

I have a class with a Map and the values of the map are also maps. The java code looks like this:
Code:
private TreeMap<Integer, TreeMap<Integer, Subject>> timetable = new TreeMap<Integer, TreeMap<Integer, Subject>>();


My Problem is that i don´t know what i have to write in the mapping file.
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="schoolplaner">
  <class name="Timetable" table="TIMETABLE">
    <id name="id" column="TIMETABLE_ID">
      <generator class="native"/>
    </id>
    <property name="effectivWith" type="calendar"/>
    <map name="timetable" table="TimetableSubjects">
      <key column="id"/>
      <map-key type="integer"/>
      <!-- ??? -->
    </map>
  </class>
</hibernate-mapping>

This is my mapping file. Normally you write "element" or "one/many-to-many" after the map-key, but what do i have to write when the element is a map?

I hope you have understood me. My english is not very good.

Thank you in advance.
SebiB90


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 11, 2007 11:11 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Collections in Collections are not supported. If you hit this limitation it's usually an indicator of a wrong domain model that will be a nightmare to use.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.