In the parent JPA Entity say "Campaign" I have following attributes
Code:
@ManyToMany(fetch=FetchType.EAGER)
private List<InstallerSize> installerSizeList = new ArrayList<InstallerSize>();
@ManyToMany(fetch=FetchType.EAGER)
private List<InstallerPackaging> installerPackagingList = new ArrayList<InstallerPackaging>();
When there are more then 1 InstallerSize or InstallerPackaging associated with "Campaign" I was getting the exception that ENtity cannot be found.
In Mongo db the Part of Campaign was like
Code:
"installerPackagingList" : [
1
],
"installerSizeList" : [
"1",
"2"
],
So on InstallerSize HIbernate was failing saying that InstallerSize with id 1 cannot be found but when I change installer size list in db like
Code:
"installerSizeList" : [
"1"
]
It works fine i.e with one record.
One important thing to notice in Exception stack trace above is
Code:
at org.hibernate.ogm.type.impl.ManyToOneType.nullSafeGet(ManyToOneType.java:35) ~[hibernate-ogm-core-5.0.1.Final.jar:5.0.1.Final]
Because some manytoOneType is in action in manyto many relation I defined in "Campaign" i.e parent object, but that is my rough guess.