How do you write a converter for an entity with a compound primary key?
I want to edit the entity with a URl such as `\edit_representative.xhtml?emp_id=12345&project_id=45
I'm using Omnifaces so I have something like this for single primary keys
<o:viewParam name="emp_id" value="#{projectRepEdit.projectRep}"
converter="#{projectRepConverter}"
converterMessage="Bad request. Unknown Project Representative." required="true"
requiredMessage="Bad request. Please use a link from within the system." />
but I how do pass the project_id the employee is working on to the converter
EDIT
Based on BalusC's answer I used the second option and have the following in my projectRepConverter
Converter
String project_id = (String) component.getAttributes().get("project_id");
String emp_id= (String) component.getAttributes().get("emp_id");
ProjectRep prjRep = prjRepRepository.getByEmpIdAndProjectId(emp_id,project_id);
return prjRep;
and in the facelet
<f:metadata>
<o:viewParam name="project_id" value="#{projectRepEdit.project}"
converter="#{projectConverter}"
converterMessage="Bad request. Unknown Project." required="true"
requiredMessage="Bad request. Please use a link from within the system." />
<o:viewParam name="badge" value="#{projectRepEdit.projectRep}"
converter="#{projectRepConverter}"
converterMessage="Bad request. Unknown Project Rep." required="true"
requiredMessage="Bad request. Please use a link from within the system.">
<f:attribute name="project_id" value="#{param.project_id}" />
<f:attribute name="emp_id" value="#{param.emp_id}" />
</o:viewParam>