I'm sure there's a really quick and easy way of doing this, but I can't think of one:
Based on a criteria I'm finding a list of objects, I only need one field (String), so I'd like it to be a String[] instead.
How do I do this?
I've come up with the following;
Code:
Criteria criteria = session.createCriteria(NotificationRequest.class);
criteria.add(Expression.eq("requestorId", requestorId));
List list = criteria.list();
String[] subjects = new String[list.size()];
// process the list, each notificationrequest as one String subject
return subjects;
But I think there's a more intuitive way