I would like to create a custom content entity object, so that it may delivered as a notification to a watcher, who may then access it. However, when I try to create the notification, it throws a hibernate exception claiming my entity is not a sub class of ContentEntityObject.
So, what am I doing wrong? My instinct says I need to provide something in my class definition, but the documentation in this area is sorely lacking, to put it nicely.
org.springframework.orm.hibernate5.HibernateSystemException: Unable to resolve entity name from Class [com.*******.atlassian.confluence.report.content.DownloadableContent] expected instance/subclass of [com.atlassian.confluence.core.ContentEntityObject]; nested exception is org.hibernate.HibernateException: Unable to resolve entity name from Class [com.*******.atlassian.confluence.report.content.DownloadableContent] expected instance/subclass of [com.atlassian.confluence.core.ContentEntityObject]
org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:296)
org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:364)
org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:328)
org.springframework.orm.hibernate5.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:706)
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao.saveRaw(HibernateObjectDao.java:242)
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao.save(HibernateObjectDao.java:202)
com.atlassian.confluence.impl.mail.notification.persistence.CachingNotificationDao.save(CachingNotificationDao.java:74)
com.atlassian.confluence.mail.notification.DefaultNotificationManager.addContentNotification(DefaultNotificationManager.java:108)
The class definition. And yes, it is empty. I would put stuff in there, and I'm sure I need to put something in there, but quite frankly, I have no idea what kind of stuff is needed. As I said, the documentation is a bit sparse.
package com.*******.atlassian.confluence.report.content;
import com.atlassian.confluence.content.CustomContentEntityObject;
public class DownloadableContent extends CustomContentEntityObject {
}
Never mind. Just saw the following in the javadoc
Protected. If you want a new CustomContentEntityObject, get it from the CustomContentManager
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.