Re: Digest for querydsl@googlegroups.com - 1 update in 1 topic

21 views
Skip to first unread message

Liam Coughlin

unread,
Jan 20, 2021, 4:24:37 AM1/20/21
to Querydsl
what dialect does HibernateUtilities.getSqlQueryFactory();?

the @ in cars@cardb_dblink makes it think it needs to be quoted.   This is very necessary functionality depending on the underlying sql dialect, because
   select * from "this table"

is not the same as
   select * from this table

you might want to represent your dblink differently, or might be an issue with the sql dialect.

On Wed, Jan 20, 2021 at 10:09 AM Querydsl <quer...@googlegroups.com> wrote:
quer...@googlegroups.com: Jan 16 04:12AM -0800

My code
SQLQueryFactory queryFactory = HibernateUtilities.getSqlQueryFactory();
QRepairsOrderV repairs_order_v = new QRepairsOrderV("repairs_order_v");
QRepairsAutoV repairs_auto_v = new QRepairsAutoV("repairs_auto_v");
QRepairsCardatabase repairs_cardatabase = new QRepairsCardatabase(
"repairs_cardatabase");
QFleetDealers fleet_dealers = new QFleetDealers("fleet_dealers");
QCar car = new QCar("cars@cardb_dblink");
PathBuilder<Car> cr = new PathBuilder<>(Car.class, "cr");
 
SQLQuery<UniqueVinRow> query = queryFactory.select(Projections.constructor(
UniqueVinRow.class, repairs_order_v.dealer_code,
HibernateUtilities.TO_CHAR(repairs_order_v.order_payment_date, "MM-YYYY"),
repairs_auto_v.vin, repairs_cardatabase.car_model, repairs_cardatabase.myear,
repairs_cardatabase.saledate,
cr.getDate("delivery_customer_date", Date.class)))
.from(repairs_order_v)
.innerJoin(repairs_auto_v).on(repairs_order_v.id.eq(repairs_auto_v.order_id
))
.innerJoin(repairs_cardatabase).on(repairs_cardatabase.vin.eq(
repairs_auto_v.vin))
.leftJoin(car, cr).on(repairs_auto_v.vin.eq(cr.get("vin")))
.where(repairs_order_v.order_status.eq("P"))
.distinct();
 
SQL I get
select distinct repairs_order_v.dealer_code,
to_char(repairs_order_v.order_payment_date,'MM-YYYY'), repairs_auto_v.vin,
repairs_cardatabase.car_model, repairs_cardatabase.myear,
repairs_cardatabase.saledate, cr.delivery_customer_date
from repairs_order_v
inner join repairs_auto_v
on repairs_order_v.id = repairs_auto_v.order_id
inner join repairs_cardatabase
on repairs_cardatabase.vin = repairs_auto_v.vin
left join* "cars@cardb_dblink"* cr
on repairs_auto_v.vin = cr.vin
where repairs_order_v.order_status = ?
 
Why *cars@cardb_dblink *is quoted?? Also rowid is quoted unless a string
Template
is used. All is fine without them. This unnecessary functionality breaks
everything. How can I switch it off?
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to querydsl+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages