3 Replies Latest reply on Jan 18, 2007 12:02 AM by fabio.ita04

    Entity Id as Page Parameters (pages.xml)

    fabio.ita04 Newbie

      Hi,

      I'm trying to write a simple application using Seam Framework, based on the seam reference documentation. I have a search screen, that displays a list of entities. For each entity on the list, there's a hyperlink that can be clicked to display an edit page.

      Seam reference tells the developer to write the hyperlink as <s:link> with <f:param>, and declares that param at pages.xml, so it can be passed to EntityHome.

      So I'm facing a problem: the param is passed to EntityHome as String, and EntityHome invokes

      E result = getEntityManager().find( getEntityClass(), getId() );

      but my entity identifier is Long typed, so hibernate throws

      org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Long, got class java.lang.String.

      How can I solve this?

      Thanx,
      Fábio.