Hi there.
I've mapping question. I'm using database which is not done in the proper way.
So eg. table looks like:
Code:
dummy(id, info_a, info_b, info_c, extra_a, extra_b)
I would like to map this database without changing (because of legacy support) in object way.
So I would like to have object "Dummy" and inside it 3 fields
id, info and extra. "Info" and "Extra" will be separate classes. It is easy done such thing in Castor because Castor permits to override get and set method. How to do this in Hibernate? Is it possible? How mapping should looks like? And how to use XDoclet to get mapping be done automatically in that kind of classes.
Eg. classes looks like:
Code:
public Dummy {
private int id;
private Extra extra = new Extra();
private Info info = new Info();
public int getId() {
return id;
}
public Extra getExtra() {
return extra;
}
public Info getInfo() {
return info;
}
/* ... setter methods follows here */
}
public Extra {
private int a;
private int b;
private int c;
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getB() {
return c;
}
/* ... setter methods follows here */
}
Info class is similar to Extra.
Kindly regards.
Sebastian Gil