package abacus.springboot.example.impl;

import java.util.Map;

import javax.persistence.Query;

public class MyJpaUtils {
	
	
	/**
	 * 给hql参数设置值
	 * 
	 * @param query  查询
	 * @param params 参数
	 */
	public void setParameters(Query query, Map<String, Object> params) {
		for (Map.Entry<String, Object> entry : params.entrySet()) {
			query.setParameter(entry.getKey(), entry.getValue());
		}
	}
	
}
