Reputation: 12997
I have a table in mysql which has just on record. when I execute following hql query in netbeans HQL I got the following answer which is correct:
query:
from Customer as cust
response:
CustomerID PhoneNumber MainAddress SubAddress RequesstNumber Name
1 22334455 Niavaran shahrake naft 3 Javad
but when I execute this query by select it do not work correctly.
query:
select cust.name from Customer as cust
response:
Bytes Bytes Bytes Bytes Chars Chars
[B@16bdee0
does anyone know the reason?
Upvotes: 0
Views: 3206
Reputation: 24169
When you write:
from Customer as cust
it litterally means that you select all columns:
select * from Customer as cust
Concerning your second request, it is strange. Could you post your exact mapping ?
Upvotes: 1
Reputation: 14121
Hibernate queries are case-sensitive. Perhaps you should try cust.Name
instead of cust.name
.
Upvotes: 1