Hi,
I'm using hbm2java 3.2.3.GA. For collection fields my generated code looks like this:
Code:
private Map<Integer,Foobar> foobars = new HashMap<Integer,Foobar>(0);
public Map<Integer,Foobar> getFoobars() {
return this.foobars;
}
public void setFoobars(Map<Integer,Foobar> foobars) {
this.foobars = foobars;
}
I would like to generate code like below instead, so that collections are always referenced using their concrete type (e.g. HashMap, LinkedList, TreeSet), not an abstract type (Map, List, Set):
Code:
private HashMap<Integer,Foobar> foobars = new HashMap<Integer,Foobar>(0);
public HashMap<Integer,Foobar> getFoobars() {
return this.foobars;
}
public void setFoobars(HashMap<Integer,Foobar> foobars) {
this.foobars = foobars;
}
I know that hbm2java's default pattern - using abstract classes where possible - provides flexibility and is generally a good one, I'm using it myself all the time. However I don't need the flexibility in this case and the use of abstract classes incurs a performance hit to do with RPC serialization.
Is there a way to accomplish this without having to touch the hbm2x source code?
Apologies if this question was answered before.
Thank you,
Julian