@SuppressWarnings("unchecked")
	public int getNbSmsWithState(final Integer msgId, final Application app, final List<String> list) {
			DetachedCriteria criteria = DetachedCriteria.forClass(Sms.class);
			criteria.add(Restrictions.eq(Sms.PROP_INITIAL_ID, msgId));
			criteria.add(Restrictions.eq(Sms.PROP_APP, app));
			criteria.add(Restrictions.in(Sms.PROP_STATE, list));
			List<Sms> sms = getHibernateTemplate().findByCriteria(criteria);  
			return  sms.size();   
			
	}
@ SuppressWarnings ( "unchecked" ) public int getNbSmsWithState ( final Integer msgId , final Application app , final List < String > list ) { DetachedCriteria criteria = DetachedCriteria . forClass ( Sms . class ) ; criteria . add ( Restrictions . eq ( Sms . PROP_INITIAL_ID , msgId ) ) ; criteria . add ( Restrictions . eq ( Sms . PROP_APP , app ) ) ; criteria . add ( Restrictions . in ( Sms . PROP_STATE , list ) ) ; List < Sms > sms = getHibernateTemplate ( ) . findByCriteria ( criteria ) ; return sms . size ( ) ; }
@return the number of sms having one of the wanted states