net.sf.webphotos.dao.jpa
Class WebPhotosDAO<E extends HasID,I>

java.lang.Object
  extended by net.sf.webphotos.dao.jpa.WebPhotosDAO<E,I>
Direct Known Subclasses:
AlbumDAO, CategoryDAO, CreditsDAO, PhotoDAO

public class WebPhotosDAO<E extends HasID,I>
extends Object

Author:
Guilherme L A Silva

Field Summary
protected  javax.persistence.EntityManager entityManager
           
 
Constructor Summary
WebPhotosDAO(Class<E> entityClass, Class<I> keyClass)
           
 
Method Summary
 javax.persistence.Query createNativeQuery(String query)
          Deprecated.  
protected  List<E> find(String query)
           
 E findBy(I id)
           
protected  List<E> findByNamedQuery(String query)
           
 List<Object[]> findByNativeQuery(String query)
          Deprecated.  
 javax.persistence.EntityManager getEntityManager()
           
 void remove(E object)
           
 void save(E object)
           
 void setEntityManager(javax.persistence.EntityManager entityManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityManager

protected javax.persistence.EntityManager entityManager
Constructor Detail

WebPhotosDAO

public WebPhotosDAO(Class<E> entityClass,
                    Class<I> keyClass)
Method Detail

createNativeQuery

@Deprecated
public javax.persistence.Query createNativeQuery(String query)
Deprecated. 

Workarround for a rapid migration from RowSet

Parameters:
query -
Returns:

findBy

public E findBy(I id)

save

public void save(E object)
          throws Exception
Throws:
Exception

remove

public void remove(E object)
            throws Exception
Throws:
Exception

getEntityManager

public javax.persistence.EntityManager getEntityManager()
Returns:
the entityManager

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)
Parameters:
entityManager - the entityManager to set

findByNativeQuery

@Deprecated
public List<Object[]> findByNativeQuery(String query)
Deprecated. 

Workarround for a rapid migration from RowSet

Parameters:
query -
Returns:

find

protected List<E> find(String query)

findByNamedQuery

protected List<E> findByNamedQuery(String query)


Copyright © 2008-2012. All Rights Reserved.