-->
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: Small problem
PostPosted: Sun Jul 03, 2011 3:31 am 
Newbie

Joined: Sun Jul 03, 2011 3:21 am
Posts: 1
Hy guys,

I am new to hibernate but i cant get pass this problem.. glad if you could help me:
I have a small table with 2 fields, an identifier and a string.
I have a class called "Privilegii", made the mapping accordingly...


The problem: Even though i have in the mysql table the values:
1880214295591 | STUDENT
1880214295591 | PROFESOR
1880214295591 | DOG

Once i use this:
List priv = session.createSQLQuery("SELECT * FROM PRIVILEGII WHERE CNP="+jTextField2.getText()).addEntity(Privilegii.class).list();

I get the right size ( 3.. or whatever) but all the values are the same.. meaning the arrayList returns 188021429591 and STUDENT no matter the position in the array.

Please help :D


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.