use of org.asqatasun.entity.parameterization.ParameterFamily in project Asqatasun by Asqatasun.
the class AbstractRuleImplementationTestCase method createParameter.
/**
*
* @param familyValue
* @param elementValue
* @param value
* @return
*/
protected Parameter createParameter(String familyValue, String elementValue, String value) {
ParameterFamily parameterFamily = PARAMETER_FAMILY_FACTORY.create();
parameterFamily.setParameterFamilyCode(familyValue);
ParameterElement parameterElement = PARAMETER_ELEMENT_FACTORY.create();
parameterElement.setParameterFamily(parameterFamily);
parameterElement.setParameterElementCode(elementValue);
Parameter parameter = PARAMETER_FACTORY.create();
parameter.setValue(value);
parameter.setParameterElement(parameterElement);
return parameter;
}
use of org.asqatasun.entity.parameterization.ParameterFamily in project Asqatasun by Asqatasun.
the class ParameterDataServiceImplTest method getParameter.
private Parameter getParameter(String family, String element, String value) {
ParameterFamily pf = new ParameterFamilyImpl();
pf.setParameterFamilyCode(family);
//ELEMENT1
ParameterElement pe = new ParameterElementImpl();
pe.setParameterElementCode(element);
Parameter p = new ParameterImpl();
p.setParameterElement(pe);
p.setValue(value);
return p;
}
use of org.asqatasun.entity.parameterization.ParameterFamily in project Asqatasun by Asqatasun.
the class ParameterFamilyDAOImpl method findParameterFamilyFromCode.
@Override
public ParameterFamily findParameterFamilyFromCode(String parameterFamilyCode) {
Query query = entityManager.createQuery("SELECT pf FROM " + getEntityClass().getName() + " pf" + " WHERE pf.paramFamilyCode = :parameterFamilyCode");
query.setParameter("parameterFamilyCode", parameterFamilyCode);
try {
return (ParameterFamily) query.getSingleResult();
} catch (NoResultException nre) {
return null;
} catch (NonUniqueResultException nure) {
return null;
}
}
Aggregations