Hi,
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:
- Beneficiary Bank Account
- 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 com.haulmont.cuba.core.global.DeletePolicy;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
@Table(name = "FUNDRAISER_BENEFICIARY_BANK_ACCOUNT")
@Entity(name = "fundraiser_BeneficiaryBankAccount")
public class BeneficiaryBankAccount extends StandardEntity {
private static final long serialVersionUID = -4769306480790398843L;
@NotNull
@Column(name = "BANK_ACCOUNT_NUMBER", nullable = false, unique = true, length = 20)
protected String bankAccountNumber;
@NotNull
@Composition
@OnDelete(DeletePolicy.CASCADE)
@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;
@Table(name = "FUNDRAISER_BENEFICIARY_BANK")
@Entity(name = "fundraiser_BeneficiaryBank")
public class BeneficiaryBank extends StandardEntity {
private static final long serialVersionUID = -6569043862030557952L;
@NotNull
@Column(name = "BANK_CODE", nullable = false, unique = true, length = 5)
protected String bankCode;
@NotNull
@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="http://schemas.haulmont.com/cuba/screen/window.xsd"
caption="msg://editorCaption"
focusComponent="form"
messagesPack="com.fundraiser.web.screens.beneficiarybankaccount">
<data>
<instance id="beneficiaryBankAccountDc"
class="com.fundraiser.entity.BeneficiaryBankAccount"
view="beneficiaryBankAccount-view-bank">
<loader/>
<instance id="beneficiaryBankDc" property="beneficiaryBank" />
</instance>
</data>
<dialogMode height="600"
width="800"/>
<layout expand="editActions" spacing="true">
<form id="form" dataContainer="beneficiaryBankAccountDc">
<column width="250px">
<textField id="bankAccountNumberField" property="bankAccountNumber"/>
<pickerField id="beneficiaryBankField" property="beneficiaryBank">
<actions>
<action id="lookup" type="picker_lookup"/>
<action id="clear" type="picker_clear"/>
</actions>
</pickerField>
</column>
</form>
<hbox id="editActions" spacing="true">
<button action="windowCommitAndClose"/>
<button action="windowClose"/>
</hbox>
</layout>
</window>
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