Class Account{ String accountno;
Customer owner;
........
} Class Customer{ .....
} 一个用户有多个account,一个account 只属于一个用户, 想通过 accountno 读取到customer 对象。
select a.owner from Account a where a.accountNo="+accountno; 不行 请指教怎样写sql , 多谢
Customer owner;
........
} Class Customer{ .....
} 一个用户有多个account,一个account 只属于一个用户, 想通过 accountno 读取到customer 对象。
select a.owner from Account a where a.accountNo="+accountno; 不行 请指教怎样写sql , 多谢
你的Accout和Customer是在同一张表里?
a.owner 这是一个列吗?
Account account = new Account();
Customer owner = account.getOwer();
//...
就可以了