Hi all:
I need you on the table vaadin show me the name of the city is realacionado field with the user table … thanks
I’m using BeanItemContainer
In my model Ciudad:
[code]
…
@OneToMany(mappedBy=“ciudad”)
private List usuario=new ArrayList();
public List<Usuario> getUsuario() {
return usuario;
}
public void setUsuario(List<Usuario> usuario) {
this.usuario = usuario;
}
…
[/code]In my model Usuario:
@ManyToOne
@JoinColumn(name="ciudad_id")
private Ciudad ciudad;
public Ciudad getCiudad() {
return ciudad;
}
public void setCiudad(Ciudad ciudad) {
this.ciudad = ciudad;
}
My table in vaadin:
UsuarioDAO cDAO=new UsuarioDAO();
BeanItemContainer bic = new BeanItemContainer<Usuario>(Usuario.class, cDAO.mostrarTodo());
tabla.setContainerDataSource(bic);
But the result in my table is:
BARRIA
TOLEDO
988378
com.ricardo.proyecto.model.Ciudad@4591fa8e <--- is My city
ACTIVO
232323
1
RICARDO
I need :
BARRIA
TOLEDO
9883378
PUNTA ARENAS <-- name of the table Ciudad
ACTIVO
232323
1
RICARDO
Thanks all.