cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

JAVA Api - fetch relation without a query

I have a Account class:

public class Account implements{
    @Id
    @GeneratedValue
    private Long id;

    @Relationship("IN_TENANT")
    private Tenant tenant;
    //... getters and setters here
}

I am trying to fetch account where tenant.id = id

Account  account= getAccount();
Filter tenantFilter = new Filter("id", ComparisonOperator.EQUALS, 
account.getTenant().getId());
      tenantFilter.setNestedPath(new Filter.NestedPathSegment("tenant", Tenant.class));


sessionFactory.getNeo4jSession().loadAll(Account.class, tenantFilter ,3);

I'm always getting 0 results (removing the filter will return all the results...)

What's wrong with my query?

I want to use the java api and not writing a query.

Thanks

2 REPLIES 2

Here is a code you can run locally, will be glad if you can help out: https://repl.it/repls/AdventurousBrokenAbstraction
thanks

I think that's not an officially supported API. Usually you'd write a query.