Sorry, no, the only identifier is RouteKey. This is not clear probably because I left off some clarifying information and I'm sorry for that. I was hoping to get away without providing the following. Here is the mapping file for Route class.
Code:
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="model.Route" table="route" >
<composite-id name="key" class="model.RouteKey" >
<key-property name="f1" type="java.lang.String" column="F1" length="31" />
<key-property name="f2" type="java.lang.String" column="F2" length="31" />
<!-- more key-properties, about 15 -->
</composite-id>
<property name="f16" type="java.lang.String" column="F10" length="23" />
<property name="f17" type="int" column="F11" />
</class>
</hibernate-mapping>
So, you can see that the identifier of the Route is always the composite RouteKey.
The string parameter passed into the newRouteKey and newRoute methods is only used to generate values for the fields. They are not identifiers. For example:
Code:
private RouteKey newRouteKey(String s) {
RouteKey k = new RouteKey();
k.setF1 = s + "F1";
k.setF2 = s + "F2";
// and so forth
return k;
}
and then
Code:
private Route newRoute(String s) {
Route r = new Route();
r.setF1 = s + "F1";
r.setF2 = s + "F2";
// and so forth
r.setF16 = s + "F16";
return r;
}
Of course this code is not doing anything useful exept provide data while I try to ramp up on the hibernate interfaces.
Here are class definitions of Route and RouteKey so that you could see how they relate:
Code:
class RouteKey implements Serializable {
private String f1;
// and so on
public String getF1() {return f1;}
public void setF1(String s) {f1 = s; }
// andso on
}
class Route {
// key fields data members and accessors
private RouteKey key;
public String getF1() {return key.getF1(); }
public void setF1(String s) {key.setF1(s); }
// and so on
// non-key fields data members and accessors
private String f16;
private int f17;
public String getF16() {return f16;}
public void setF16(String s) {f16 = s;}
}