You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class ProfileEntity{
.......
@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.PERSIST)
@JoinProperty(name="emailNotificationsId")
private List emailNotifications;
}
For this structure i am getting below error while fetching ProfileEntity data
io.github.kaiso.relmongo.exception.RelMongoProcessingException: unable to set mappedBy child object Can not set java.util.List field com.test.core.profile.entity.EmailNotificationsEntity.profiles to com.test.core.profile.entity.ProfileEntity
The text was updated successfully, but these errors were encountered:
Hello @munish-usit thank you for using RelMongo, your issue is that @ManyToOne can only be used on an attribute of type object and not collection so in your case you should have : @ManyToOne(mappedBy = "emailNotifications") private ProfileEntity profile;
Hello @kaiso ,
Thanks for your solution. Your solution has solved the run time error, but unfortunately, in my use case I have to use List profiles because its a many to many relationship.
One profile can have many email notifications.
One email notification can be subscribed by many profile.
Do you have any plan to support List in many to many relationship ?
I am using below structure
class ProfileEntity{
.......
@OneToMany(fetch=FetchType.EAGER, cascade=CascadeType.PERSIST)
@JoinProperty(name="emailNotificationsId")
private List emailNotifications;
}
public class EmailNotificationsEntity {
}
For this structure i am getting below error while fetching ProfileEntity data
io.github.kaiso.relmongo.exception.RelMongoProcessingException: unable to set mappedBy child object Can not set java.util.List field com.test.core.profile.entity.EmailNotificationsEntity.profiles to com.test.core.profile.entity.ProfileEntity
The text was updated successfully, but these errors were encountered: