-->
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: Please Help! java.util.Map with Object as element
PostPosted: Tue Jun 28, 2005 4:50 pm 
Newbie

Joined: Tue Jun 28, 2005 4:26 pm
Posts: 5
Hey all,

I've RTFM, RTFAQ, and googled like crazy. I can't seem to solve my problem. Here goes. Using Hibernate 3.0.5

I have an object like this:

Code:
public class ActionDefinition  {
...
  private Map inputDefns = new HashMap();
  private Map outputDefns = new HashMap();
...
}


Each of the maps have a string key, and stores an ActionParameter object which is defined as follows:

Code:
public class ActionParameter {
  private String name;
  private String actParmId;
  private String type;
  private List actionParameterSource;
  private ActionDefinition parent;
  private int revision;
}


The actionParameterSource list contains ActionParameterSource objects. And so on.

I've not had any luck with the mapping configurations for this model - here's what I've got currently:

Fragment from ActionDefinition...
Code:
...
      <map name="inputDefns" table="INPDEFNS" lazy="true" inverse="true" cascade="all-delete-orphan">
        <key column="INPTACTDEFNPARM" />
        <map-key column="INPDEFKEY" type="string" length="50" />
        <one-to-many class="org.pentaho.repository.solution.ActionParameter"/>
      </map>
      <map name="outputDefns" table="OUTPDEFNS" lazy="true" inverse="true" cascade="all-delete-orphan">
        <key column="OUTPTACTDEFNPARM" />
        <map-key column="OUTDEFKEY" type="string" length="50" />
        <one-to-many class="org.pentaho.repository.solution.ActionParameter"/>
      </map>



Fragment from ActionParameter...
Code:
  <class name="org.pentaho.repository.solution.ActionParameter" table="ACTNPARM">
     <id column="ACTPARMID" name="actParmId" type="string" length="100">
        <generator class="assigned" />
     </id>
      <version column="REVISION" name="revision" />
      <property name="name" type="string" not-null="true">
        <column name="NAME" length="200" not-null="true" />
      </property>
      <property name="type" type="string" not-null="true">
        <column name="PARMTYPE" length="200" not-null="true" />
      </property>
      <list name="actionParameterSource" lazy="true" table="ACTNPARMSOURCE" inverse="true" cascade="all,delete-orphan">
        <key column="ACTPARMSOURCEID" />
        <index column="LISTIDX" />
        <one-to-many class="org.pentaho.repository.solution.ActionParameterSource" />
      </list>
      <many-to-one name="parent"
        class="org.pentaho.repository.solution.ActionDefinition"
        column="parent_id"
        not-null="true"/>
   </class>



What I expected was for the tables INPDEFNS and OUTPDEFNS to be created which would essentially be a mapping table, mapping a string key to the appropriate ID in the ActionParameter table. What happens instead is that INPDEFNS and OUTPDEFNS never get created. Instead, four new columns get added to the ACTNPARM table.

I'm puzzled as to how I can represent this relationship properly. Can anybody help? I have to believe that this is possible - I'm just not seeing it yet.

Thanks,

Marc


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.