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: List results of an annotated class
PostPosted: Mon Apr 18, 2011 11:27 am 
Newbie

Joined: Mon Apr 18, 2011 11:14 am
Posts: 2
Hello There.
I'm facing a problem that it's driving me nuts, it never happened to me before, so that's because I'm begging for help

I got an annotated class with 3 fields

Code:
@Entity
@Table(name="all_input_sources",schema="store")
@Immutable
public class SourceView {
   
   @Id
   private String source_type_name;
   
   private String source_type_label;
   
   private String source_name;

   public String getSource_type_name() {
      return source_type_name;
   }

   public void setSource_type_name(String source_type_name) {
      this.source_type_name = source_type_name;
   }

   public String getSource_type_label() {
      return source_type_label;
   }

   public void setSource_type_label(String source_type_label) {
      this.source_type_label = source_type_label;
   }

   public String getSource_name() {
      return source_name;
   }

   public void setSource_name(String source_name) {
      this.source_name = source_name;
   }

}


Well, when from the DAO related with this class I try to get all the records of this class via Criteria as you can see below
Code:
public List<Source> findAll() {
      return session.createCriteria(Source.class).list();
   }


it launches the query (I check the SQL fired), but it replicates the first row as many times as records I have in my table....

The results of the HQL are correct, the problem came when It populate the list created, it seem like it not iterates properly.
Anyone have the slightest idea what's going on?

Many thanks in advance.


Top
 Profile  
 
 Post subject: Re: List results of an annotated class
PostPosted: Tue Apr 19, 2011 4:31 am 
Newbie

Joined: Mon Apr 18, 2011 11:14 am
Posts: 2
Ok... my fault ...
I had the wrong @Id field...

Thanks anyway


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.