-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Query alias in generated SQL
PostPosted: Wed Aug 10, 2011 8:36 am 
Newbie

Joined: Mon Apr 18, 2011 6:51 am
Posts: 4
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 ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.