Hi, I'm relatively new to Hibernate (though I have done a fair amount of general JPA work) and I have having serious trouble finding information on the following.
I would like to create an Entity that looks like (annotations/getters/setters omitted): public class TestEntity { @Id private Long pk; public ComplexPojo fieldOne; public ComplexPojo fieldTwo; . . .y public ComplexPojo fieldX; }
public class ComplexPojo { public String value; public Integer version; }
ideally when this persists in the database it looks like table: TestEntity ------------------------------- Key | FieldOneValue | FieldOneVersion | FieldTwoValue | FieldTwoVersion etc ...
I have found ways to persist this structure in a "Many to One" environment, but in the interest of keeping this readable by humans I would like to keep it all on one table.
Is there a solution around this? (I'm not opposed to writing XML tools to deal with the complexity if its an option, I'd prefer not to do this dynamic framework through the JDBC if I can avoid it).
|