Hi,
I have a problem, the same as described in the JIRA issue
http://opensource.atlassian.com/project ... se/HBX-906.
By reading the issue comments and searching around I wasn't able to find the info on if this issue is now solved or how to implement the toString() method in order to do some workaround.
Currently, what I have is this:
- I type the query in Editor window:
Code:
select new CompanyDetails(
count(u), u.company.name
)
from User u
group by u.company.name
-CompanyDetails class is implemented:
Code:
public class CompanyDetails {
private Long numberOfTotalEmployees;
private String companyName;
public CompanyDetails(Long numberOfTotalEmployees, String companyName) {
this.numberOfTotalEmployees = numberOfTotalEmployees;
this.companyName = companyName;
}
public Long getNumberOfTotalEmployees() {
return numberOfTotalEmployees;
}
public void setNumberOfTotalEmployees(Long numberOfTotalEmployees) {
this.numberOfTotalEmployees = numberOfTotalEmployees;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Override
public String toString() {
return "<" + this.companyName + "><" + this.numberOfTotalEmployees + ">";
}
}
-The result I get in the "Hibernate Query Result" view is:
Quote:
-----------------------------------------
| <CompanyName><number> | ? |
-----------------------------------------
| <CompanyName><number> | ? |
-----------------------------------------
with no details available in the "Properties" view.
Any help on this one?
PS. I know other ways to retrieve information I'm trying with above way. But I want to use dynamic instantiation, and the above code is just a simple example. If the simplest doesn't work than what will work?