Sep 20 2007

Totally FREE !!!!!!!!!!

Tag: Hibernateberrisch @ 7:06 pm
List utypesList = hs.createSQLQuery("SELECT {utypes.*} FROM utypes LIMIT 0,10") 
			.addEntity("utypes", Utypes.class) 
			.list();
 
if (!utypesList.isEmpty()) { 
	iterator iter = utypesList.iterator(); 
	while (iter.hasNext()) { 
		Utypes utypeBean = (Utypes)iter.next(); 
	} 
}

Sep 19 2007

Count all rows of a table

Tag: Hibernateberrisch @ 4:04 pm
int paginationSize = 10;
int pages = 0;
float countCities = 0;
 
List countCitiesList = hs.createSQLQuery("SELECT count(id) AS count FROM cities")
	.addScalar("count",  Hibernate.INTEGER)
	.list();
 
if (!countCitiesList.isEmpty()) {
	Iterator tmp_iter = countCitiesList.iterator();
	while (tmp_iter.hasNext()) {
	    	Integer tmp_ii = (Integer)tmp_iter.next();
	        countCities = tmp_ii.floatValue();
	}
}
 
pages = Math.round( countCities / paginationSize );

Sep 19 2007

Java Basics

Tag: Javaberrisch @ 3:53 pm



Only round this result of this java operation.

 
int pages = Math.round( countCities / paginationSize );

Next Page »