I suppose I can post something to JIRA. I've never done that before, but I'm sure I can figure it out...
WRT what I'm doing, maybe I could send you my hackup versions of ClassMapping, CodeGenerator, and BasicRenderer.
What I have working, at least for what I've tried so far, is:
given the mappings
<set name="attrs" table="StationAttrs" lazy="true"
cascade="all" >
<key column="stationId"/>
<composite-element class="&util_pkg;.DescribedProperty" >
<property name="name" type="string" />
<property name="value" type="string" />
<property name="description" type="string" />
</composite-element>
</set>
<set name="installedHardware"
lazy="true" inverse="true"
cascade="save-update" >
<key column="stationId" />
<one-to-many class="&isis_pkg;.InstalledHardware" />
</set>
<set name="stationLogEntries" lazy="true"
inverse="true" cascade="save-update"
sort="&sort_pkg;.LogSorter" >
<key column="stationId" />
<one-to-many class="&isis_pkg;.LogEntry" />
</set>
I get
public Set getAttrs() {
return this.attrs;
}
public void setAttrs(Set attrs) {
this.attrs = attrs;
}
public void addAttr(DescribedProperty aAttr) {
if ( null == this.getAttrs() )
setAttrs(new HashSet())
this.getAttrs().add(aAttr);
}
public Set getInstalledHardware() {
return this.installedHardware;
}
public void setInstalledHardware(Set installedHardware) {
this.installedHardware = installedHardware;
}
public void addInstalledHardware(InstalledHardware aInstalledHardware) {
if ( null == this.getInstalledHardware() )
setInstalledHardware(new HashSet())
this.getInstalledHardware().add(aInstalledHardware);
}
public SortedSet getStationLogEntries() {
return this.stationLogEntries;
}
public void setStationLogEntries(SortedSet stationLogEntries) {
this.stationLogEntries = stationLogEntries;
}
public void addStationLogEntry(LogEntry aStationLogEntry) {
if ( null == this.getStationLogEntries() )
setStationLogEntries(new TreeSet(new isis.LogSorter()))
this.getStationLogEntries().add(aStationLogEntry);
}
I'd like to be able to do the inverse relationship setting too.
The SortedSet problem was described in an earlier post. Did that make sense?
Thanks,
Linus
linus --> iris.washington.edu
|