cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

from ContentItem to (WTDocument or ContentHolder)

sanisimov
8-Gravel

from ContentItem to (WTDocument or ContentHolder)

Good day to all.

I'm querying some ContentItem instances (primary ApplicationData of WTDocument). For some reason API ContentItem.getHolderLink() returns "null" to me. What ways can get it's parent ContentHolder or WTDocument by having ContentItem?

 

Thanks 🙂

4 REPLIES 4
Florent
15-Moonstone
(To:sanisimov)

Hello,

 

your ask is a bit weird as we usually get the ContentItem (or ApplicationData) from the ContentHolder.

How did you come to get the ContentItem without the ContentHolder ?

From a DB perspective, the link it HolderToContent.

 

Florent ROUSSEL
www.4cad.ca

thanks for answer. I'm querying ContentItems directly (by their name, description, etc.), cuz it's little bit faster then query all ContentHolders then  go over it and find what i need. But may be not xD

Florent
15-Moonstone
(To:sanisimov)

Ok, then you have to navigate the link

 

QueryResult navigate = PersistenceHelper.manager.navigate(contentItem, "theContentHolder", HolderToContent.class);
Florent ROUSSEL
www.4cad.ca

Hi,

In Windchill JavaDoc, it is mentioned "Non-persistent reference to the link between the ContentHolder and the ContentItem".

Hence you have to setHolderLink manually by Java code before call getHolderLink method, otherwise it will throw NPE. Hope it helps you.

Announcements

Top Tags