Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Mapping a Database View


tch wrote:
> 
> No, that would give you identity/caching issues.
> 
> If there are 3 columns that will always make a row unique in your view
> you can set that as a compound primary key for example.
> 
> 

Sorry if I appear dense, but I don't understand.

I've got a view in the database that is defined as

CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL
SECURITY DEFINER VIEW `vw_Ecu` AS select `t1`.`platformId` AS
`platformId`,`t1`.`busId` AS `busId`,`t1`.`txAddress` AS
`txaddress`,`t0`.`idsText` AS `idsText`,`t0`.`idsName` AS
`idsName`,`t1`.`description` AS `description`,`t1`.`version` AS `version`
from (`PEcu` `t0` join `PEcuText` `t1`) where ((`t0`.`platformId` =
`t1`.`platformId`) and (`t0`.`txaddress` = `t1`.`txAddress`) and
(`t0`.`busid` = `t1`.`busId`))

where platformId, busId and txAddress form a unique identifier that is, in
fact the primary key of both underlying tables. Would you be kind enough to
explain or show me how you would map this as vw_Ecu.java

Regards

-- 
View this message in context: http://www.nabble.com/Mapping-a-Database-View-tp25401383p25402514.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top