To fazendo um select tentando pegar o ultimo codigo na tabela, como jogo isso em um inteiro para retornar?
public int getMaxIdInscricao(){
Session sessao = HibernateUtility.getSession();
Transaction tx = sessao.beginTransaction();
int i;
Query select = sessao.createQuery("select max(ev.INS_ID) from TB_EVENTOS as ev");
tx.commit();
sessao.close();
}