Hi Christian,
I have tested the following and all 3 work as I would expect.
1) Find all datasets with a given name (‘Default’)
object[] results = service.search(sessionId, "1,5 Dataset [name='Default']");
2) Find all investigations with a given name (‘Fe70Ni30-MA RT-5min’) that have datasets with a given name (‘Default’)
object[] results = service.search(sessionId, "Investigation [title='Fe70Ni30-MA RT-5min'] <-> Dataset [name='Default']");
3) Find all datasets with a given name (‘Default’) in investigations with a given name ('Fe70Ni30-MA RT-5min’)
object[] results = service.search(sessionId, "Dataset [name='Default'] <-> Investigation [title='Fe70Ni30-MA RT-5min']");
This is tested in an environment where my account has direct permission on all objects,
The code is part of my ingest code for ISIS (hardcoded name and title values in this email example)
This is done from a C# client.
Best,
Tom
1) Find all datasets with a given name (‘Default’)
object[] results = service.search(sessionId, "1,5 Dataset [name='Default']");
The actual JPQL that is being generated is quite different
Tom: JPQL: SELECT Dataset$ FROM Dataset AS Dataset$ WHERE (Dataset$.name = 'Default')
Christian: JPQL: SELECT Dataset$ FROM Dataset AS Dataset$ JOIN Dataset$.investigation AS Investigation$ JOIN Investigation$.investigationUsers AS InvestigationUser$ WHERE (Dataset$.name = 'PG')
I suspect this is because a permission rule is being applied via Investigation and InvestigationUser (see log file output below – mine only has 1 authz rule)
What auth rules do you have set?
I am also on 4.2.1
I use the “1,5” restriction simply because every investigation in my ICAT has a ‘Default’ dataset – 150,000+ in total.
Best,
Tom
2012-12-06 15:13:23,106 [http-thread-pool-8181(1)] DEBUG ICAT - Method org.icatproject.exposed.ICAT.login() took 0.482s to execute
2012-12-06 15:13:49,375 [http-thread-pool-8181(5)] DEBUG ICAT - Invoking org.icatproject.exposed.ICAT.search()
2012-12-06 15:13:49,378 [http-thread-pool-8181(5)] DEBUG BeanManager - user: uows/13574 is associated with: eda7f99a-40e3-4777-92ac-d904bbd5a566
2012-12-06 15:13:49,378 [http-thread-pool-8181(5)] DEBUG BeanManager - uows/13574 searches for 1,5 Dataset [name='Default']
2012-12-06 15:13:49,381 [http-thread-pool-8181(5)] DEBUG SearchQuery - Got 1 authz queries for search by uows/13574 to a Dataset
2012-12-06 15:13:49,381 [http-thread-pool-8181(5)] INFO SearchQuery - Null restriction => Operation permitted
2012-12-06 15:13:49,382 [http-thread-pool-8181(5)] DEBUG BeanManager - JPQL: SELECT Dataset$ FROM Dataset AS Dataset$ WHERE (Dataset$.name = 'Default')
2012-12-06 15:13:49,384 [http-thread-pool-8181(5)] DEBUG BeanManager - Obtained 5 results.
2012-12-06 15:13:49,386 [http-thread-pool-8181(5)] DEBUG ICAT - Method org.icatproject.exposed.ICAT.search() took 0.011s to execute