Hi,
i have a question about using an alias in a query. I use the following simple query:
Code:
session.createQuery("select this_ from WheelStorage as this_ where this_.customer.id = :customerId")
.setParameter("customerId", customer.getId())
.list();
The problem is that in the generated SQL the alias
this_ is not used.
Here are the logs:
Code:
14:30:52,340 INFO [STDOUT] Hibernate:
14:30:52,340 INFO [STDOUT] select
14:30:52,340 INFO [STDOUT] wheelstora0_._id as column1_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_._uuid as column2_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.deleted as deleted26_,
14:30:52,340 INFO [STDOUT] wheelstora0_._version as column4_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_._branchId as column17_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.branchIndependent as branchIn5_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_._customerId as column18_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_._userId as column19_26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.active as active26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.comment as comment26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.endDate as endDate26_,
14:30:52,340 INFO [STDOUT] wheelstora0_.hubCapCount as hubCapCo9_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.orderNumber as orderNu10_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.rimLockCount as rimLock11_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.storageDate as storage12_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.storageNumber as storage13_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.swapDate as swapDate26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.type as type26_,
14:30:52,341 INFO [STDOUT] wheelstora0_._vehicleId as column20_26_,
14:30:52,341 INFO [STDOUT] wheelstora0_.wheelNutCount as wheelNu16_26_
14:30:52,341 INFO [STDOUT] from
14:30:52,341 INFO [STDOUT] wheelstorages wheelstora0_
14:30:52,341 INFO [STDOUT] where
14:30:52,341 INFO [STDOUT] ? = _branchId
14:30:52,341 INFO [STDOUT] and wheelstora0_._customerId=?
Is that the normal behavior ?