HQL IN Clause with Array from DB + JOIN
i have a Table where an ArrayList of prices is saved via Hibernate as a Blob. Now i will get access to that list via IN cl开发者_开发问答ause. Is this possible? All with a JOIN of two tables
i.e. with:
SELECT * FROM products as p, prices as pr WHERE pr.id IN p.prices
p.prices contains an ArrayList with the id of the prices
No that is not possible. If you do wish to do anything like this you should store a string of price_id's as a CLOB (TEXT) and use LIKE '%yourID%' OR LIKE '%anotherId%'. But watch out though, this is ugly and you need to make sure you cater for situations so that looking up id 5 is not matched by id 15.
It sounds like you are taking some shortcuts you should seriously reconsider.
精彩评论