org.milyn.scribe.adapter.jpa.EntityManagerDaoAdapter Maven / Gradle / Ivy
/*
Milyn - Copyright (C) 2006 - 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (version 2.1) as published by the Free Software
Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.scribe.adapter.jpa;
import java.util.Collection;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.milyn.assertion.AssertArgument;
import org.milyn.scribe.Dao;
import org.milyn.scribe.Flushable;
import org.milyn.scribe.Locator;
import org.milyn.scribe.Queryable;
/**
* This is an adapter for the EntityManager. This enables
* simple queries on a EntityManager.
*
* Prefixing a query with a @ makes sure that
* the query is handled as a named query. The @
* is off course removed before the named query is called
*
* @author [email protected]
*
*/
class EntityManagerDaoAdapter implements Dao