[UPDATE] Add custom hql query function