HQL query to search by ContentProperty Edited


I'm working on a Confluence Server plugin using CustomContentEntityObjects as outlined in https://bitbucket.org/resah/confluence-custom-content-example. Creating and storing the entities works like a charm and I can use HQL to fetch them using several different fields of CustomContentEntityObject (e.g. title or body).

However, I cannot for the life of me, figure out how to find objects using ContentProperties. As an example I have this code when setting the property:

contentEntityObject.getProperties().setLongProperty(PAGE_ID_KEY, page.getId());
// ...
customContentManager.saveContentEntity(contentEntityObject, SAVE_CONTEXT);

How can I retrieve this object using the page id?

Kind regards,

1 answer


I belive you can find the Content properties using getLongProperty:

contentEntityObject.getProperties().getLongProperty(String name, long defaultValue) 


I knew that already. My goal was to retrieve CustomContentEntityObjects using HQL without having to do additional filtering in Java. See my answer to this question for a solution.

Well, scratch that. The language filter does not permit submitting my source code.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,088 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you