I am trying to map Oracle nested tables within Hibernate. Instead of using an intermediate relationship table, I am using nested tables in order to keep a more OR model. However, at this point, I am using Jakarta Commons Digester in order to map my result set (in XML) into an bean graph. I would like to go straight from a result set to POJOs without the intermediate step of converting to XML.
Suppose I have the following user master example,
create type ROLE_TY as object (
roleId NUMBER,
active SMALLINT);
create type ROLE_NT as table of ROLE_TY;
create table UserMaster (
userId NUMBER,
login VARCHAR2(25),
lastName VARCHAR2(25),
firstName VARCHAR2(25),
roleList ROLE_NT)
nested table roleList store as ROLELIST_TAB;
The POJOs that I would map to would be something like:
class UserMaster {
private long userId;
private String login;
private String lastName;
private String FirstName;
private List roleList = new ArrayList();
...... }
class Role {
private long roleId;
private short active;
..... }
Any assistance in creating a mapping file would be greatly appreciated. It appears as though Hibernate will do the job, but I just can't quite figure it out. I've looked through Hibernate in Action and the web, and I can't seem to find any reference to Oracle nested tables.
Thanks
|