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

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

import de.ivu.elect.business.ui.entity.UITableColumnOrder;

@javax.enterprise.context.ApplicationScoped // ELECT-7845
public class UITableColumnOrderDAO extends AbstractUITableColumnOrderDAO {

  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(UITableColumnOrder uiTableColumnOrder){
    getEntityManager().persist(uiTableColumnOrder);
  }

  public void remove(UITableColumnOrder uiTableColumnOrder){
    getEntityManager().remove(uiTableColumnOrder);
  }

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

                    
        /**
        * Name: BenutzerKeyAndColumnBuilderKeyNoFlush<br>
        * Beschreibung: <br>
        * EJBQL: SELECT o FROM UITableColumnOrder o WHERE o.columnBuilderKey = ?2 AND o.benutzerKey=?1<br>
        * SQL: <br>
        */
        @Override
        public java.util.List<UITableColumnOrder> findByBenutzerKeyAndColumnBuilderKey( @javax.annotation.Nonnull String benutzerKey,  @javax.annotation.Nonnull String columnBuilderKey) {

        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("UITableColumnOrder.findByBenutzerKeyAndColumnBuilderKey" ,  benutzerKey ,  columnBuilderKey  );

        Object cached = daoCache.findInCache(key);

        if (cached==null) {
          return daoCache.cache(key, super.findByBenutzerKeyAndColumnBuilderKey( benutzerKey ,  columnBuilderKey  ));
        }
        return (java.util.List<UITableColumnOrder>) cached;
        }
            return super.findByBenutzerKeyAndColumnBuilderKey( benutzerKey ,  columnBuilderKey  );
            }
                    
@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();
}
}



}