public List<BOFile> getAllFile(BOProject project, BOUser user) {
SessionFactory sessionFactory = null;
Session session = null;
try {
sessionFactory = HibernateSessionFactory.getInstance();
session = sessionFactory.openSession();
Criteria criteria = session.createCriteria(BOFile.class);
criteria.add(Restrictions.eq("project", project));
criteria.add(Restrictions.sqlRestriction(" file_id in(select max(fl.file_id) from files as fl group by fl.file_version_id) "));
return criteria.list();
} catch (Exception a_th) {