JPA Container - Filter problem

I have a JPA container, and I am trying to add a couple of filters to it (not necessarily at the same time). In both cases, the filter is a text string, and the code to add the filters looks like this:

        private void applyDescFilter(){
		String fString = txt_Desc_Filter.getValue() + "%";
		Filter f ="trafficReport.desc", fString, false);
	private void applyRRDFilter(){
		String fString = txt_RRD_Filter.getValue() + "%";
		Filter f ="rPath", fString, false);

A call to the second filter (on rPath) works. The first one fails with this error:

SEVERE: Terminal error:
Cause: java.lang.IllegalArgumentException: Invalid filter
	at com.vaadin.event.ListenerMethod.receiveEvent(
	at com.vaadin.event.EventRouter.fireEvent(
	at com.vaadin.ui.AbstractComponent.fireEvent(
	at com.vaadin.ui.AbstractField.fireValueChange(
	at com.vaadin.ui.AbstractField.setValue(
	at com.vaadin.ui.AbstractTextField.changeVariables(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(
	at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(
	at org.vaadin.artur.icepush.ICEPushServlet.service(
	at javax.servlet.http.HttpServlet.service(
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(
	at org.apache.catalina.core.StandardWrapperValve.invoke(
	at org.apache.catalina.core.StandardContextValve.invoke(
	at org.apache.catalina.core.StandardHostValve.invoke(
	at org.apache.catalina.valves.ErrorReportValve.invoke(
	at org.apache.catalina.core.StandardEngineValve.invoke(
	at org.apache.catalina.connector.CoyoteAdapter.service(
	at org.apache.coyote.http11.Http11Processor.process(
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: java.lang.IllegalArgumentException: Invalid filter
	at com.vaadin.addon.jpacontainer.filter.util.AdvancedFilterableSupport.addFilter(
	at com.vaadin.addon.jpacontainer.JPAContainer.addFilter(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.vaadin.event.ListenerMethod.receiveEvent(
	... 25 more

The only difference I can see is that the rPath field comes directly from the table associated with the JPAContainer. The description column is a generated column (a foreign key field). Can someone tell me what I need to do to get the first filter to work properly?

At one time, I think I had this working - but I don’t remember changing anything in this area of the code… I’m guessing I’ve done something really dumb…

thanks very much,


After much digging, I found the correct way to create a one-to-one mapping, and that seems to have solved this issue. I had a many-to-one mapping of the TrafficReport object and it should be one-to-one. Fixing this seems to have made the problem go away.

For the record, the code looks like this:

In the RRDRecord class:

private TrafficReport trafficReport;

and in the TrafficReport object:

private RrdRecord rrdRecord;

This, along with the appropriate getters and setters seems to work.