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.