Unified queries for Java