MyFaces Core
  1. MyFaces Core
  2. MYFACES-1447

@EmbeddedId/@Embeddable PK static inner class bug ?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      JDK 1.5.06

      Description

      I'm trying a JSF code similar to:

      <li>Number:<h:inputText value="#

      {contract.pk.number}

      " required="true" id="pk_number" /></li>
      <li>Alias:<h:inputText value="#

      {contract.pk.alias}

      " required="true" id="pk_alias" /></li>

      The contract bean looks like:

      public class Contract implements Serializable {
      @EmbeddedId
      private Contract.PK pk;
      ...
      @Embeddable
      public static class PK implements Serializable {
      private String number;
      private String alias;
      ...
      public String getNumber()

      { return this.number; }

      public void setNumber(String sNumber)

      {...}
      public String getAlias() { return this.alias; }
      public void setAlias(String sAlias) {...}

      }
      }

      Whatever I input into my form a "conversion error" is returned since getPk() returns null.

      To solve the problem I have to explicetely initialize the pk member:

      public class Contract implements Serializable {
      @EmbeddedId
      private Contract.PK pk = new Contract.PK();
      ...
      }

      More info:
      http://forum.java.sun.com/thread.jspa?threadID=774503&tstart=30

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Enrique Arizon Benito
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development