HbnContainer + Table and ID column visibility

Hello, I have the following problem with hbncontainer and table: I have a simple entity (just 2 fields: id and name) and I want to display the data in Table. However when I try to do it I can see only the ‘name’ column in the Table and even table.setVisibleColumns(new String{“id”, “name”}); doesn’t help. It seems that the ‘id’ column is not available. Below is the entity code:

@Entity
@SequenceGenerator(initialValue = 1, name = "idgen", sequenceName = "project_seq")
public class Project implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "idgen")
    private Long id;
    private String name;
    
    public Project() {
    }
    
	public Long getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}

Is it a normal behaviour and do I need to use ColumnGenerator?

Hi,

Well, it is normal for HbnContainer :-). I’d guess it only shows read and write properties (with both getter and setter). If you can find an easy way to add support for read only properties, I’m happy to commit your patch to HbnContainer.

IMO a ColumnGenerator as a workaround is not a bad option.

cheers,
matti