Hi
I have to store informations about video programs. Each program can have several descriptions, depending on the media it is published on.
A way to represent them in database would be :
Code:
program < prog_id, title, ... >
desc_a < prog_id, prop_a1, prop_a2, ... >
desc_b < prog_id, prop_b1, ... >
Mapped objects :
Code:
public class Program {
public long id;
public String title;
public DescA descA;
public DescB descB;
}
public class DescA {
public Program prog; /* optional */
public String propA1;
public int propA2;
// ...
}
descN property of a Program object should be null if this program dosn't have a desc_N description. Descriptions can be added to a previously defined program.
I didn't find a good way to map this schema and thoses classes. (the solution would be near from a table-per-subclass inheritance mapping, but inheritance is not usable here.)
Does anyone have an idea for this mapping ? Or for alternative schema/classes ?
Thanx
Pierre Tramo