views:

123

answers:

2

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?

+1  A: 

Hibernate queries are case-sensitive. Perhaps you should try cust.Name instead of cust.name.

André Neves
A: 

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 ?

KLE
i want specific column
JGC
I understand. You showed your request (HQL) but you didn't provide your mapping (.hbm file for example, or annotated entities). That's what I was asking for.
KLE