One to One Composition Problem with PickerField


I am new to Cuba Platform and have been trying the platform for a couple of days.
The framework and platform is awesome and has helped me in developing web applications fast.

I have been trying to make a One to One Composition between 2 entities:

  1. Beneficiary Bank Account
  2. Beneficiary Bank

For the relation of the entities in the table is working properly but I have a problem with the Edit Screen in which I use a PickerField and always come out with this error: com.fundraiser.entity.BeneficiaryBank-4fc0bed7-4eb7-e09f-000a-164b99530da8 [detached]


The following is my entity:

Beneficiary Bank Account

package com.fundraiser.entity;

import com.haulmont.chile.core.annotations.Composition;
import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.cuba.core.entity.annotation.OnDelete;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Entity(name = "fundraiser_BeneficiaryBankAccount")
public class BeneficiaryBankAccount extends StandardEntity {
    private static final long serialVersionUID = -4769306480790398843L;

    @Column(name = "BANK_ACCOUNT_NUMBER", nullable = false, unique = true, length = 20)
    protected String bankAccountNumber;

    @OneToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "BENEFICIARY_BANK_ID")
    protected BeneficiaryBank beneficiaryBank;

    public BeneficiaryBank getBeneficiaryBank() {
        return beneficiaryBank;

    public void setBeneficiaryBank(BeneficiaryBank beneficiaryBank) {
        this.beneficiaryBank = beneficiaryBank;

    public String getBankAccountNumber() {
        return bankAccountNumber;

    public void setBankAccountNumber(String bankAccountNumber) {
        this.bankAccountNumber = bankAccountNumber;

Beneficiary Bank

package com.fundraiser.entity;

import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity(name = "fundraiser_BeneficiaryBank")
public class BeneficiaryBank extends StandardEntity {
    private static final long serialVersionUID = -6569043862030557952L;

    @Column(name = "BANK_CODE", nullable = false, unique = true, length = 5)
    protected String bankCode;

    @Column(name = "BANK_NAME", nullable = false)
    protected String bankName;

    public String getBankName() {
        return bankName;

    public void setBankName(String bankName) {
        this.bankName = bankName;

    public String getBankCode() {
        return bankCode;

    public void setBankCode(String bankCode) {
        this.bankCode = bankCode;

The following is my view:


The following is my screen:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns=""
        <instance id="beneficiaryBankAccountDc"
            <instance id="beneficiaryBankDc" property="beneficiaryBank" />
    <dialogMode height="600"
    <layout expand="editActions" spacing="true">
        <form id="form" dataContainer="beneficiaryBankAccountDc">
            <column width="250px">
                <textField id="bankAccountNumberField" property="bankAccountNumber"/>
                <pickerField id="beneficiaryBankField" property="beneficiaryBank">
                        <action id="lookup" type="picker_lookup"/>
                        <action id="clear" type="picker_clear"/>
        <hbox id="editActions" spacing="true">
            <button action="windowCommitAndClose"/>
            <button action="windowClose"/>

Can anybody provide some help as to why the error message is displaying in the Picker Field?
Any suggestions would be appriciated?

Thank you Very Much

Hi @jtempest2424 ,

please add @NamePattern("%s|bankName") inisde your beneficiaryBank then picker field will display the bank name inside the drop down .

you can follow Data Modelling for more explanation

Also you can follow Customer Editor With a List of Orders as reference


Thanks for the advice. It is showing up now.