use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class ParameterDAOImpl method findLevelParameter.
@Override
public Parameter findLevelParameter(String parameterValue) {
Query query = entityManager.createQuery("SELECT p FROM " + getEntityClass().getName() + " p" + " WHERE p.parameterElement.parameterElementCode = :parameterElementCode" + " AND p.parameterValue = :parameterValue");
query.setParameter("parameterValue", parameterValue);
query.setParameter("parameterElementCode", "LEVEL");
try {
return (Parameter) (query.getSingleResult());
} catch (NoResultException nre) {
return null;
}
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class ParameterDAOImpl method findParameterSetFromAudit.
@Override
public Set<Parameter> findParameterSetFromAudit(Audit audit) {
if (audit != null) {
Query query = entityManager.createQuery("SELECT a FROM " + AuditImpl.class.getName() + " a" + " WHERE a.id = :idAudit");
query.setParameter("idAudit", audit.getId());
try {
audit = (Audit) (query.getSingleResult());
Set<Parameter> paramSet = new HashSet<Parameter>();
paramSet.addAll(audit.getParameterSet());
return paramSet;
} catch (NoResultException nre) {
return null;
}
}
return null;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class ParameterDAOImpl method findDefaultParameter.
@Override
public Parameter findDefaultParameter(ParameterElement parameterElement) {
Query query = entityManager.createQuery("SELECT p FROM " + getEntityClass().getName() + " p" + " WHERE p.isDefaultParameterValue = :isDefault" + " AND p.parameterElement = :parameterElement");
query.setParameter("isDefault", true);
query.setParameter("parameterElement", parameterElement);
try {
return (Parameter) query.getSingleResult();
} catch (NoResultException nre) {
return null;
} catch (NonUniqueResultException nure) {
return (Parameter) query.getResultList().iterator().next();
}
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class ParameterFactoryImpl method createParameter.
@Override
public Parameter createParameter(ParameterElement parameterElement, String value) {
Parameter parameter = new ParameterImpl();
parameter.setDefaultParameterValue(false);
parameter.setParameterElement(parameterElement);
parameter.setValue(value);
return parameter;
}
use of org.asqatasun.entity.parameterization.Parameter in project Asqatasun by Asqatasun.
the class AuditLauncherController method setLevelParameter.
/**
* @param paramSet
* @param level
* @return
*/
private Set<Parameter> setLevelParameter(Set<Parameter> paramSet, String level) {
Parameter levelParameter = parameterDataService.getLevelParameter(level);
paramSet = parameterDataService.updateParameter(paramSet, levelParameter);
return paramSet;
}
Aggregations