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