cancel
Showing results for 
Search instead for 
Did you mean: 

Query associated with target instead of source not working

isanalon
Champ in-the-making
Champ in-the-making
Hi everybody.
I've got an application where I query associated nodes in the following way:


RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();         
       Association[] assoc = {new Association("my:ClausulaPliegoC", AssociationDirectionEnum.source)};

try {
queryAssociated = repositoryService.queryAssociated(node, assoc);
ResultSet associatedResultSet = queryAssociated.getResultSet();
ResultSetRow[] rows = associatedResultSet.getRows();


Everything works fine and I get results (rows != null)
The problem appears when I try to query the other way around, using
AssociationDirectionEnum.target instead of AssociationDirectionEnum.source

Using that, I get no results (rows==null).

If my association is A->B, I was getting correctly B from A, but now I want to get A from B. How can I do it if this code is failing?
1 REPLY 1

isanalon
Champ in-the-making
Champ in-the-making
Do I need to change something on my model?

<association name="my:ClausulaPliegoC">
  <title>Clausulas en Pliego</title>
  <target>
  <class>my:ClausulaenPliego</class>
  <mandatory>false</mandatory>
  <many>true</many>
  </target>
  </association>

Do I have to add any tag so I can navigate back from the target node to the source node?

I'll be very grateful for any hints provided on this.