You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Josh <gi...@comcast.net> on 2005/08/25 04:07:15 UTC

How would you perform CRUD operations on a "table per subclass"?

All,

 

Given the following:

 

create table application_user (

    user_name varchar(35) not null,    

    password varchar(255) not null,

    first_name varchar(50) not null,

    last_name varchar(50) not null,

    email varchar(255) not null,

    password_hint varchar(255),

    enabled bool,

    constraint pk_application_user_user_name primary key (user_name)

);

 

create table team_administrator (

    user_name varchar(35) not null,

    team_id int8 not null,

    constraint pk_team_administrator primary key (user_name)

);

 

 

ApplicationUser is currently an abstract class.  TeamAdministrator extends
ApplicationUser.  

 

 

 

 

How would you perform inserts/updates using this design?  Is it better to
keep you classes 1:1 with database tables when using IBATIS?

 

Regards,

 

Joshua