BeanFieldGroup error

I am using JPA to pull data from the database to an entity bean. Then using the entity bean, I want to map it to my UI form. Here’s the code below.

EntityManagerFactory emFactory = Persistence

    em = emFactory.createEntityManager();
    BeanItem<EntityAccount> item = new BeanItem<EntityAccount>(em.find(
            EntityAccount.class, new Long(6)));

    BeanFieldGroup<EntityAccount> binder = new BeanFieldGroup<EntityAccount>(
    binder.bind(_nameField, "altername_name");

    this._saveButton.addClickListener(e -> e.getButton().setCaption(
            "Save record"));



  • The persistent class for the entity_account database table.

@NamedQuery(name=“EntityAccount.findAll”, query=“SELECT e FROM EntityAccount e”)
public class EntityAccount implements Serializable {
private static final long serialVersionUID = 1L;

private Long id;

private String alternateName;

private String createdBy;

private Date createdTime;

private Date effectiveDate;

private java.math.BigInteger entityId;

private String fein;

private Date obsoleteDate;

private String shortName;

private String updatedBy;

private Date updatedTime;

public EntityAccount() {

public Long getId() {

public void setId(Long id) { = id;

public String getAlternateName() {
    return this.alternateName;

public void setAlternateName(String alternateName) {
    this.alternateName = alternateName;

public String getCreatedBy() {
    return this.createdBy;

public void setCreatedBy(String createdBy) {
    this.createdBy = createdBy;

public Date getCreatedTime() {
    return this.createdTime;

public void setCreatedTime(Date createdTime) {
    this.createdTime = createdTime;

public Date getEffectiveDate() {
    return this.effectiveDate;

public void setEffectiveDate(Date effectiveDate) {
    this.effectiveDate = effectiveDate;

public java.math.BigInteger getEntityId() {
    return this.entityId;

public void setEntityId(java.math.BigInteger entityId) {
    this.entityId = entityId;

public String getFein() {
    return this.fein;

public void setFein(String fein) {
    this.fein = fein;

public Date getObsoleteDate() {
    return this.obsoleteDate;

public void setObsoleteDate(Date obsoleteDate) {
    this.obsoleteDate = obsoleteDate;

public String getShortName() {
    return this.shortName;

public void setShortName(String shortName) {
    this.shortName = shortName;

public String getUpdatedBy() {
    return this.updatedBy;

public void setUpdatedBy(String updatedBy) {
    this.updatedBy = updatedBy;

public Date getUpdatedTime() {
    return this.updatedTime;

public void setUpdatedTime(Date updatedTime) {
    this.updatedTime = updatedTime;


When I execute the code, I get “Bean property ‘altername_name’ not found”. What am I doing wrong?


You should map it against the field name, which is “alternateName”, and not against the database column name.

 binder.bind(_nameField, "alternateName");

Thanks…that was it.