/*
 * JPA DAO Template
 *
 *
 * Takatuka - Template fuer JPA DAO
 *
 */

package de.ivu.elect.business.staat.boundary;

import de.ivu.elect.business.staat.entity.Staat;

@javax.enterprise.context.ApplicationScoped // ELECT-7845
public class StaatDAO extends AbstractStaatDAO {

  private static final long serialVersionUID = 1L;

  @javax.inject.Inject
  private transient de.ivu.elect.jee.entity.SimpleDAO simpleDAO;

  @Override
  protected javax.persistence.EntityManager getEntityManager() {
    return simpleDAO.getEntityManager();
  }

  public void persist(Staat staat){
    getEntityManager().persist(staat);
  }

  public void remove(Staat staat){
    getEntityManager().remove(staat);
  }

@javax.inject.Inject
private transient de.ivu.elect.presentation.system.DAOCache daoCache;

                    
        /**
        * Name: AllHavingCustomCodeStaatNoFlush<br>
        * Beschreibung: <br>
        * EJBQL: SELECT obj FROM Staat obj WHERE obj.customCodeStaat IS NOT NULL<br>
        * SQL: <br>
        */
        @Override
        public java.util.List<Staat> findByAllHavingCustomCodeStaat() {

        if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
        de.ivu.elect.presentation.system.FinderKey key = new de.ivu.elect.presentation.system.FinderKey("Staat.findByAllHavingCustomCodeStaat"  );

        Object cached = daoCache.findInCache(key);

        if (cached==null) {
          return daoCache.cache(key, super.findByAllHavingCustomCodeStaat( ));
        }
        return (java.util.List<Staat>) cached;
        }
            return super.findByAllHavingCustomCodeStaat( );
            }
                                        
        /**
        * Name: AllHavingCustomCodeStaatsangehoerigkeitNoFlush<br>
        * Beschreibung: <br>
        * EJBQL: SELECT obj FROM Staat obj WHERE obj.customCodeStaatsangehoerigkeit IS NOT NULL<br>
        * SQL: <br>
        */
        @Override
        public java.util.List<Staat> findByAllHavingCustomCodeStaatsangehoerigkeit() {

        if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
        de.ivu.elect.presentation.system.FinderKey key = new de.ivu.elect.presentation.system.FinderKey("Staat.findByAllHavingCustomCodeStaatsangehoerigkeit"  );

        Object cached = daoCache.findInCache(key);

        if (cached==null) {
          return daoCache.cache(key, super.findByAllHavingCustomCodeStaatsangehoerigkeit( ));
        }
        return (java.util.List<Staat>) cached;
        }
            return super.findByAllHavingCustomCodeStaatsangehoerigkeit( );
            }
                                        
        /**
        * Name: AllOrderedByNameStaatNoFlush<br>
        * Beschreibung: <br>
        * EJBQL: SELECT obj FROM Staat obj ORDER BY obj.nameStaat<br>
        * SQL: <br>
        */
        @Override
        public java.util.List<Staat> findByAllOrderedByNameStaat() {

        if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
        de.ivu.elect.presentation.system.FinderKey key = new de.ivu.elect.presentation.system.FinderKey("Staat.findByAllOrderedByNameStaat"  );

        Object cached = daoCache.findInCache(key);

        if (cached==null) {
          return daoCache.cache(key, super.findByAllOrderedByNameStaat( ));
        }
        return (java.util.List<Staat>) cached;
        }
            return super.findByAllOrderedByNameStaat( );
            }
                                        
        /**
        * Name: AllOrderedByNameStaatsangehoerigkeitNoFlush<br>
        * Beschreibung: <br>
        * EJBQL: SELECT obj FROM Staat obj ORDER BY obj.nameStaatsangehoerigkeit<br>
        * SQL: <br>
        */
        @Override
        public java.util.List<Staat> findByAllOrderedByNameStaatsangehoerigkeit() {

        if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
        de.ivu.elect.presentation.system.FinderKey key = new de.ivu.elect.presentation.system.FinderKey("Staat.findByAllOrderedByNameStaatsangehoerigkeit"  );

        Object cached = daoCache.findInCache(key);

        if (cached==null) {
          return daoCache.cache(key, super.findByAllOrderedByNameStaatsangehoerigkeit( ));
        }
        return (java.util.List<Staat>) cached;
        }
            return super.findByAllOrderedByNameStaatsangehoerigkeit( );
            }
                                                                                                                                                                                    
@Override
public void clear() {
super.clear();
if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
daoCache.clear();
}

}

@Override
public void flush() {
super.flush();
if (de.ivu.elect.business.system.control.CacheQueries.CACHE_QUERIES_DAO) {
daoCache.clear();
}
}



}