/*package com.jasamedika.medifirst2000.dao.custom;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import com.jasamedika.medifirst2000.entities.PurchasedTest;

*//**
 * Repository Custom class
 * 
 * @author Roberto
 * @param <T>
 *//*
@Repository("PurchasedTestDaoCustom")
public class PurchasedTestDaoCustomImpl<T> implements PurchasedTestDaoCustom {

	@PersistenceContext
	protected EntityManager em;

	private Class<T> type;

	@SuppressWarnings("unchecked")
	public List findAll(String entity, String field) {
		// field = field.replace(",", ",model.");
		String queries = "";
		if (field.equals("*")) {
			queries = "model";
		} else if (!field.equals("")) {
			String[] fields = field.split(",");

			for (String fieldisi : fields) {
				if (!queries.equals("")) {
					queries = queries + ",";
				}
				queries = queries + "model." + fieldisi + " as " + fieldisi;
			}
			queries = " new map(" + queries + " ) ";
		} else {
			queries = "model";
		}

		// new map(model.id as id, model.nama as nama)

		final StringBuffer queryString = new StringBuffer("SELECT " + queries + " from ");
		queryString.append(entity + " model");
		final Query query = em.createQuery(queryString.toString());

		return query.getResultList();
	}

	@Override
	public long countAll() {
		return 0;
	}

	@Override
	public PurchasedTest create(PurchasedTest t) {
		return null;
	}

	@Override
	public void delete(PurchasedTest t) {
		
	}

	@Override
	public PurchasedTest update(PurchasedTest t) {
		return null;
	}

	@Override
	public List<PurchasedTest> findAll() {
		return null;
	}

	@Override
	public List<PurchasedTest> findByProperty(String property, Object value) {
		return null;
	}

}
*/