Retorna um int da consulta (hibernate)

0 respostas
C

Galera como proceder pra retorna um int a partir desta consulta?

vlwww

public int getServiceNameCode(String shDes) throws SQLException {
		
		int max;
		
		try{
			String strQuery = "select sncode from mpusntab " +
            			" where shdes = " + shDes;
			
			Query query = this.getSession().createSQLQuery(strQuery);
			
			[color=red]max = query.???????;[/color]
			
		}catch(Exception e){
			e.printStackTrace();
		}
		
		return max;
	}
Criado 28 de julho de 2011
Respostas 0
Participantes 1