-->
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: Eine Map in einer Map - wie muss die Mapping Datei aussehen?
PostPosted: Sat Mar 10, 2007 6:30 pm 
Newbie

Joined: Sat Mar 10, 2007 6:20 pm
Posts: 2
Hi,
hab vor kurzem angefangen was mit Hibernate zu programmieren. Nur jetzt habe ich ein Problem und zwar folgendes:

Ich hab in einer Klasse eine Map in einer anderen Map. Also so:
Code:
private TreeMap<Integer, TreeMap<Integer, Subject>> timetable = new TreeMap<Integer, TreeMap<Integer, Subject>>();

und ich weiß jetzt nicht, wie die Mapping Datei dazu aussehen muss. Bisher habe ich es so:
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"/>
      <!-- Was muss jetzt hier hin? -->
    </map>
  </class>
</hibernate-mapping>

Was muss jetzt nach dem map-key stehen? Normalerweise muss da jetzt Element oder One-to-Many hin, aber was kommt da hin, wenn eine Map das Element ist?

Danke schonmal im vorraus.
SebiB90


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.