Is it possible to do 'or' searches with the webapi 4.5?
I'd like to search for all incidents submitted by someone with the surname Baker.
This seems to involve looking up IPersons with the surname Baker, which is easy, and then creating an IRegsitrationWhere and adding this to the IIncidentWhere as follows: iwhere.addCriteriumOnRegistration(rw);
However, the addCriteriumOnRegistration call seems to be misleading as it suggests I can add multiple IRegistrationWhere objects, but doesn't let me specify AND/OR. Also, I'm not even sure if the addX methods actually mean "add" but should be called setX - is it possible to call the method more than once?
All added I*Where objects comprise AND condition. WEB-API does not have means to do OR searches - you need to combine more searches. There is an internal API that SD client and server use that allows for complex conditions using AND OR NOT LIKE, ... However this is not documented and uses different style of object representation. If you find that interesting try to find API documentation of SD 3.x or 4.0.
Is that API present in the Java web API, or do I need to be looking elsewhere? If you could point me in the right direction then I'd be grateful. A lack of documentation isn't so much of an issue if it's in Java.
It is not part of the WEB API. It is "internal" API that is unsupported (and undocumented) in 4.5 (but is still there). Have a look at this document: http://support.openview.hp.com/selfsolve/document/KM2015/binary/sd4apg_pdf That provides all the docs there is. It may have been altered slightly in 4.5 but the basics are still valid. Still will require some hacker abilities to make it work.
Though it provides what you're looking for it is completely different in nature from WEB API (in fact WEB API is internally mapped to this one). It has different session handling, different object styles, etc. So when you find the objects you want you will need to get their OIDs and retrieve WEB API style objects using them.