I am trying to map an existing table which looks somewhat like this:
EXTENSION_TABLE ( ID NUMBER, HEADER VARCHAR2(255), CONTENT VARCHAR2(2000), SORT_ORDER NUMBER, PARENT_KEY NUMBER )
The bean that I created looks like this:
public class ExtensionBean { private Integer id; private String header; private String content; private List<ExtensionBean> children;
public void setId(Integer id) { this.id = id; }
... etc. }
The way the data is stored, the top level record has a parent key of zero and it's children have the top level's ID in the PARENT_KEY. I have been trying to map this so that when the top level record is read, the children get loaded as well into a List<ExtensioBean>. This is a legacy table which I cannot change.
I haven't had much success so any help/info/guidance that you could provide will be greatly appreciated.
|