Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#Error while inserting CandidateCertification #283

Open
vkundral opened this issue Mar 29, 2020 · 0 comments
Open

#Error while inserting CandidateCertification #283

vkundral opened this issue Mar 29, 2020 · 0 comments

Comments

@vkundral
Copy link

Hi Team,

I was trying to persist candidateCertification entity which has fileAttachment field in it.
It is OneToMany field but I can't use 'associateWithEntity()' method as StandardFileAttachment.class is not extending BullhornEntity class. Hence, I tried as below:

CandidateCertification candidateCertification = new CandidateCertification();
Candidate cand= bullhornData.findEntity(Candidate.class, candidateId);
candidateCertification.setCandidate(cand);
Certification cert= bullhornData.findEntity(Certification.class, certId);
candidateCertification.setCertification(cert);
StandardFileAttachment standardFileAttachment = new StandardFileAttachment();
standardFileAttachment.setCandidate(cand);
standardFileAttachment.setId(fileId);
standardFileAttachment.setName(fileName);
OneToMany oneToMany = new OneToMany<>();
oneToMany.setData(Arrays.asList(standardFileAttachment));

        candidateCertification.setFileAttachments(oneToMany);
        CrudResponse crudResponse1 = bullhornData.insertEntity(candidateCertification); 

Below is the error while inserting record:
{ detailMessage=null,
propertyName=fileAttachment, severity=WARNING,
type=ATTEMPT_TO_SET_TO_MANY }

Could you please check the issue once OR suggest if we have any other way to achieve it.

Thanks!
Verinder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant