If you're looking to get at the column names that would be returned by a mapped class, you can do something like this:
Code:
Configuration cfg = HibernateUtil.getConfiguration();
PersistentClass pc = cfg.getPersistentClass(Aluno.class.getName());
Iterator properties = pc.getPropertyIterator();
while(properties.hasNext()) {
Property property = (Property) properties.next();
Iterator columns = property.getColumnIterator();
while(columns.hasNext()) {
Column column = (Column) columns.next();
System.out.println(column):
}
}
If you're looking for the column names that are returned by a query, that gets a bit more complicated. The CriteriaQuery interface wasn't designed to be used by application code and doesn't offer an easy means of getting the data that you might be looking for.
Ryan-