An important point I'd like to point out for the future generations is that the selectOneMenu need to be fed up by an array of SelectItem and
not a List as I tried and failed with
Something like this:
public
SelectItem[] getAClassInstances() {
SelectItem[] selectItems;
//querying the db with hibernate query
Session sess = HibernateUtil.getSessionFactory().openSession();
Query query = sess.createQuery("from AClass");
selectItems = new SelectItem[query.list().size()];
int ii=0;
for(Iterator it=query.iterate();it.hasNext();){
AClassap = (AClass)it.next();
SelectItem item = new SelectItem(ap,
ap.getDescription(),
ap.getDescription());
selectItems[ii]=item;
ii++;
}
return selectItems;
}