com.khubla.pragmatach.plugin.openjpa
Class OpenJPADAO<T,I extends Serializable>

java.lang.Object
  extended by com.khubla.pragmatach.framework.dao.AbstractDAO<T,I>
      extended by com.khubla.pragmatach.plugin.openjpa.OpenJPADAO<T,I>
All Implemented Interfaces:
DAO<T,I>

public class OpenJPADAO<T,I extends Serializable>
extends AbstractDAO<T,I>

Author:
tome

Constructor Summary
OpenJPADAO(Class<T> typeClazz, Class<I> identifierClazz)
           
 
Method Summary
 long count()
          get the count of rows in table
 void delete(T t)
          delete
 void deletebyId(I i)
          delete
 javax.persistence.criteria.CriteriaQuery<T> find()
          get criteria builder
 T findById(I i)
          find by id
 List<T> getAll()
          findall
 List<T> getAll(int start, int count)
          get all
protected static Set<Class<?>> getEntityClasses()
          the annotation scanner will have run; we can just query for annotated classes
 Class<I> getIdentifierClazz()
           
 Class<T> getTypeClazz()
           
 void reloadConfig()
          do a config reload
 void save(T t)
          save object
 void update(T t)
          update object
 
Methods inherited from class com.khubla.pragmatach.framework.dao.AbstractDAO
getPager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenJPADAO

public OpenJPADAO(Class<T> typeClazz,
                  Class<I> identifierClazz)
Method Detail

getEntityClasses

protected static Set<Class<?>> getEntityClasses()
                                         throws PragmatachException
the annotation scanner will have run; we can just query for annotated classes

Throws:
PragmatachException

count

public long count()
           throws PragmatachException
Description copied from interface: DAO
get the count of rows in table

Throws:
PragmatachException

delete

public void delete(T t)
            throws PragmatachException
delete

Throws:
PragmatachException

deletebyId

public void deletebyId(I i)
                throws PragmatachException
delete

Throws:
PragmatachException

find

public javax.persistence.criteria.CriteriaQuery<T> find()
                                                 throws PragmatachException
get criteria builder

Throws:
PragmatachException

findById

public T findById(I i)
           throws PragmatachException
find by id

Throws:
PragmatachException

getAll

public List<T> getAll()
               throws PragmatachException
findall

Throws:
PragmatachException

getAll

public List<T> getAll(int start,
                      int count)
               throws PragmatachException
Description copied from interface: DAO
get all

Throws:
PragmatachException

getIdentifierClazz

public Class<I> getIdentifierClazz()

getTypeClazz

public Class<T> getTypeClazz()

reloadConfig

public void reloadConfig()
Description copied from interface: DAO
do a config reload


save

public void save(T t)
          throws PragmatachException
save object

Throws:
PragmatachException

update

public void update(T t)
            throws PragmatachException
update object

Throws:
PragmatachException


Copyright © 2014 khubla.com. All rights reserved.