Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5647

Extend primary keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Release Branch 11.04, Release Branch 12.04, Release Branch 13.07, Trunk
    • None
    • framework

    Description

      At http://svn.apache.org/viewvc?view=revision&revision=431009 David "Implemented extend-entity for entity definitions to support adding field, relation and index elements to an entity; this is now also used to support further separation of the framework from the applications"

      But primary keys were not taken into account

      // this will always be true for now as extend-entity fielsd are always nonpks
      

      It turned I needed to extend a PK and using the attached simple ModelEntity.java.patch, it definitely works quite well.

      I also attach a test.entity-extend.patch for testing with a localhost trunk demo instance

      1. Apply the test.entity-extend.patch
      2. Get to https://localhost:8443/webtools/control/FindGeneric?entityName=OrderHeader, you will see the orderId extension has been taken into account in the DB: orderId * String, VARCHAR(60). I also checked creating a Postgres DB, the column is 60 chars wide.
      3. Get to https://localhost:8443/webtools/control/ViewGeneric?entityName=OrderHeader&enableEdit=true, you will see that you can't enter a PK longer than 20 chars
      4. Apply the ModelEntity.java.patch, clean-data load-demo, restart
      5. Get to https://localhost:8443/webtools/control/ViewGeneric?entityName=OrderHeader&enableEdit=true, you can enter a PK longer than 20 chars (up to 60) and create a new entity

      Though I already use this change in a custom project, I will wait some time before committing, thanks for your reviews

      Attachments

        Issue Links

          Activity

            People

              jleroux Jacques Le Roux
              jleroux Jacques Le Roux
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: