-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with HQL (Hibernate) Query using Netbeans 6.7.1
PostPosted: Mon Nov 09, 2009 2:49 pm 
Newbie

Joined: Mon Nov 09, 2009 2:45 pm
Posts: 2
Hi. I have Netbeans 6.7.1 with the Hibernate Plugin. I have a database which possesses only one table. This table is called "Login" and has two columns: "username" and "password". I have inserted two rows in it, so it is not empty.

Using HQL within Netbeans, I write the following query
Code:
FROM Login


This results in HQL showing the correct result, the two rows added. But, let's say that I wanted only one of the two columns, like "username". I would do something like this:
Code:
SELECT log.username FROM Login AS log


This gives, the column with 2 rows (as expected), but in each row appears something weird. First of all, the column is not log.username, but "Bytes". The rows have for values something like "B@ebd...", and it's completely random, for when I ask for the result again, the "B@ebd..." can change to other word but it always begins with "B@".

I don't understand what I am doing wrong. I have tried many things, like using Upper Case, Lower Case, etc. It always work when selecting ALL the items from the table, but when asking for only a column, it goes crazy. Thanks for any help you can give


Top
 Profile  
 
 Post subject: Re: Problem with HQL (Hibernate) Query using Netbeans 6.7.1
PostPosted: Mon Nov 09, 2009 3:02 pm 
Newbie

Joined: Mon Nov 09, 2009 2:45 pm
Posts: 2
What happens to me is exactly the same that's been going on with this guy:
http://stackoverflow.com/questions/1339663?sort=oldest#sort-top
Check that link if you don't understand my first post


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

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.