I'm having a kind of dummy problem, I need to make a @NamedQuery
with a join with other table, some simple thing.
But in all my @NamedQuery
I'm only dealing with my mapped Object/Table.
For example in my Object/Table Mapped cars:
@NamedQuery(name = Cars.GET_AVAILABLE_CARS,
query = "select c.id from Cars c where c.status = (select d.status from CarStatus d where d.color=red)")
I'm trying to use: @SecondaryTables
but no success for now.
One other thing that is working is give all things from other table as a parameter, but I don't think this will be good in performance.
Like:
@NamedQuery(name = Cars.GET_AVAILABLE_CARS, query =
"select c.id from Cars c where c.status = :" + CarStatusParam)
Any tips?
Thanks in advance