I'm using Spring 3.1.0.RELEASE with Hibernate 4.0.1.Final. I want to invoke a search method in a controller that takes as input a search bean (the Event bean below) ...
@RequestMapping(value = "/search_results.jsp")
public ModelAndView processSearch(final HttpServletRequest request, final Event searchBean, final BindingResult result) {
...
}
The event bean contains the following field ...
@Entity
@Table(name = "EVENTS")
public class Event implements Comparable {
...
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name="EVENT_FEED_ID")
private EventFeed eventFeed;
...
}
in which the EventFeed object contains the following fields ...
@Entity
@Table(name = "EVENT_FEEDS")
public class EventFeed {
@Id
@Column(name = "ID")
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
@NotEmpty
@Column(name = "TITLE")
private String title;
...
}
How do I construct a URL such that the search bean's Event.getEventFeed().getId() field is populated?
I realize I could submit a GET request with a parameter like "eventFeedId=2" and populate everything manually, but since other pages are submitting requests that populate the command object, I'd like to continue to use the same logic.