it.cnr.contab.consultazioni.bp.ConsObbligazioniBP Maven / Gradle / Ivy
/*
* Copyright (C) 2019 Consiglio Nazionale delle Ricerche
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
/*
* Created on Jan 19, 2005
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package it.cnr.contab.consultazioni.bp;
import it.cnr.jada.action.ActionContext;
import it.cnr.jada.action.BusinessProcessException;
import it.cnr.jada.bulk.OggettoBulk;
import it.cnr.jada.persistency.sql.CompoundFindClause;
import it.cnr.jada.util.RemoteIterator;
import it.cnr.jada.util.action.SearchProvider;
/**
* @author mincarnato
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class ConsObbligazioniBP extends ConsultazioniRestBP
implements SearchProvider {
private String componentSessioneName;
private Class bulkClass;
public ConsObbligazioniBP() {
super();
}
public ConsObbligazioniBP(String function) {
super(function);
}
protected void init(it.cnr.jada.action.Config config, it.cnr.jada.action.ActionContext context) throws it.cnr.jada.action.BusinessProcessException {
try {
super.init(config, context);
setBulkClassName(config.getInitParameter("bulkClassName"));
setComponentSessioneName(config.getInitParameter("componentSessionName"));
} catch (Throwable e) {
throw new BusinessProcessException(e);
}
}
public RemoteIterator search(
ActionContext actioncontext,
CompoundFindClause compoundfindclause,
OggettoBulk oggettobulk)
throws BusinessProcessException {
return findFreeSearch(actioncontext,
compoundfindclause,
oggettobulk);
}
public it.cnr.jada.util.RemoteIterator findFreeSearch(
ActionContext context,
it.cnr.jada.persistency.sql.CompoundFindClause clauses,
OggettoBulk model)
throws it.cnr.jada.action.BusinessProcessException {
try {
clauses = CompoundFindClause.and(clauses, getBaseclause());
it.cnr.jada.util.RemoteIterator ri =
it.cnr.jada.util.ejb.EJBCommonServices.openRemoteIterator
(context, createComponentSession().cerca(context.getUserContext(), clauses, model));
//this.setIterator(context,ri);
return ri;
} catch (Exception e) {
throw handleException(e);
}
}
/**
* @return
*/
public String getComponentSessioneName() {
return componentSessioneName;
}
/**
* @param string
*/
public void setComponentSessioneName(String string) {
componentSessioneName = string;
}
/**
* @return java.lang.Class
*/
public java.lang.Class getBulkClass() {
return bulkClass;
}
/**
* @param newBulkClass java.lang.Class
*/
public void setBulkClass(java.lang.Class newBulkClass) {
bulkClass = newBulkClass;
}
/**
* Imposta il valore della proprietà 'bulkClassName'
*
* @param bulkClassName Il valore da assegnare a 'bulkClassName'
* @throws ClassNotFoundException
*/
public void setBulkClassName(java.lang.String bulkClassName) throws ClassNotFoundException {
bulkClass = getClass().getClassLoader().loadClass(bulkClassName);
setBulkInfo(it.cnr.jada.bulk.BulkInfo.getBulkInfo(bulkClass));
setColumns(getBulkInfo().getColumnFieldPropertyDictionary());
}
}