Error persisting CustomContentEntityObject

robert_egan_305 September 10, 2020

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 {
}

 

1 answer

1 accepted

0 votes
Answer accepted
robert_egan_305 September 10, 2020

Never mind. Just saw the following in the javadoc

Protected. If you want a new CustomContentEntityObject, get it from the CustomContentManager

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.5.1
TAGS
AUG Leaders

Atlassian Community Events