Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

How to write Native SQL

$
0
0
Hi,
I am using spring data JPA for database access, I need to write complex query inorder to get data from DB, so i decided to go with pure SQL. Is it possible to write using spring data JPA? if that so is there any guide or example?
My query is:

select d from ad d
inner join prod_ad pad
ON d.ad_id=pad.ad_id inner join product a on pad.product_id=a.product_id
where a.brand_id in (
select ib.brand_id from SUBSCRIBED_CHANNEL ia
inner join product ib
where ia.channel_id=ib.product_id and ia.user_id=: productID)
and a.product_id not in (
select ib.product_id from SUBSCRIBED_CHANNEL ia
inner join product ib where ia.channel_id=ib.product_id and ia.user_id=: productID)

Viewing all articles
Browse latest Browse all 297

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom