DynamicQuery locationQuery = DynamicQueryFactoryUtil.forClass(Location.class)
.add(RestrictionsFactoryUtil.eq("name", locationName))
.setProjection(ProjectionFactoryUtil.property("locationId"));
Order order = OrderFactoryUtil.desc("modifiedDate");
DynamicQuery eventQuery = DynamicQueryFactoryUtil.forClass(Event.class)
.add(RestrictionsFactoryUtil.eq("name", eventName))
.add(RestrictionsFactoryUtil.eq("description", eventDescription))
.add(PropertyFactoryUtil.forName("locationId").in(locationQuery))