I have this projection that passes a list to a bean:
Code:
public List projectNames()
{
Criteria criteria = this.getSession().createCriteria(User.class)
.setProjection( Projections.projectionList(Projections.projectionList()
.add( Projections.property("user_ID"))
.add( Projections.property("user_Name"))
);
return criteria.list();
And when I try to retrieve the data for a jsf datatable I get results like
Code:
User ID: [Ljava.lang.Object;@14782b2
User Name: [Ljava.lang.Object;@14782b2
...
etc (but displayed in a table)
When I just add 1 projection property it works fine... by simplying using mylist.get(0).toString() mylist.get(1).toString() etc in the Bean
Code:
public List projectNames()
{
Criteria criteria = this.getSession().createCriteria(User.class)
.setProjection( Projections.projectionList(Projections.projectionList()
.add( Projections.property("user_Name"))
);
return criteria.list();
Code:
User Name: John51
User Name: Mark65
...
etc (but displayed in a table)
Ive searched all over and cant find a solution...
Does anyone know any examples or sites that expain how to deal with this?
Or does anyone know a better way to do this? (simply display info from a database table in a datatable using jsf and hibernate)
Thanks for any help