Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1340

HibernateEntityValueEncoder shouldn't throw an exception when the entity being encoded isn't persisted yet

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 5.2.3
    • Fix Version/s: None
    • Component/s: tapestry-hibernate
    • Labels:
      None

      Description

      The code:

      if (id == null)
      throw new IllegalStateException(String.format(
      "Entity %s has an %s property of null; this probably means that it has not been persisted yet.",
      value, idPropertyName));

      means that i can never encode an entity class before it's persisted. The correct behaviour should be:

      1. HibernateEntityValueEncoder - if id is not null proceed with encoding.
      2. HibernateEntityValueEncoder - if id is null then pass object to the next encoder on the chain.

        Attachments

          Activity

            People

            • Assignee:
              ongakugainochi Robert Zeigler
              Reporter:
              hpalma Hugo Palma
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: