ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koka Kiknadze" <226...@gmail.com>
Subject Re: Simple question
Date Fri, 10 Nov 2006 19:00:40 GMT
Rowhandler example is in the dev guide. But seems I've found a way to do
without it.
> at  this point changing the db schema is not an option
The idea is to mimick splitting users table
Make a view like this

select userID, customproperty1 from usersTable where customproperty1 is not
null
UNION ALL
select userID, customproperty2 from usersTable where customproperty1 is not
null
... and so on for each customproperty

Now left join your usersTable (selecting all columns except
customproperties) with this union view over userID and you can use standard
iBatis solution as described in

*1:N & M:N Solution *chapter of dev guide. Of course creation of view is not
obligatory, you could just use resulting (huge) SQL...*
*

Mime
View raw message