@SuppressWarnings("unchecked")
	public Collection<ProfileEntity> getProfilesByDynamicQuery(
			String profileTable, QueryExpression expr)
			throws UnrecognizedAttributeException,
			AttributeTypeMismatchException {

		// TODO check for exceptions

		QueryWrapper wQuery = JPAQueryBuilder.parseDynamicQuery(expr);

		EntityManager em = getEntityManager();
		Query dynamicQuery = em.createQuery(wQuery
				.getQuerySQL(profileEntityClassName));

		int i = 1;
		for (Object param : wQuery.getDynamicParameters()) {
			dynamicQuery.setParameter(i++, param);
		}

		if (wQuery.getMaxMatches() > 0)
			dynamicQuery.setMaxResults((int) wQuery.getMaxMatches());

		return dynamicQuery.getResultList();

	}
@ SuppressWarnings ( "unchecked" ) public Collection < ProfileEntity > getProfilesByDynamicQuery ( String profileTable , QueryExpression expr ) throws UnrecognizedAttributeException , AttributeTypeMismatchException { QueryWrapper wQuery = JPAQueryBuilder . parseDynamicQuery ( expr ) ; EntityManager em = getEntityManager ( ) ; Query dynamicQuery = em . createQuery ( wQuery . getQuerySQL ( profileEntityClassName ) ) ; int i = 1 ; for ( Object param : wQuery . getDynamicParameters ( ) ) { dynamicQuery . setParameter ( i ++ , param ) ; } if ( wQuery . getMaxMatches ( ) > 0 ) dynamicQuery . setMaxResults ( ( int ) wQuery . getMaxMatches ( ) ) ; return dynamicQuery . getResultList ( ) ; }
/*
(non-Javadoc)

@see
org.mobicents.slee.container.component.profile.ProfileEntityFramework
#getProfilesByDynamicQuery(java.lang.String,
javax.slee.profile.query.QueryExpression)