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