[jira] [Commented] (OFBIZ-5648) Extend primary keys

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-5648) Extend primary keys

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-5648?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14001179#comment-14001179 ]

Jacques Le Roux commented on OFBIZ-5648:
----------------------------------------

Yes did not thought about adding, only changing the type. We could restrict to this case for PK, this should not be a problem and allow to use a longer PK when needed.

Note that it's currently possible to extend the PK field size but not completly. It's anyway currently inconsistent and confusing.

Of course you can always change the definition in the core entity model files (even adding another field as a PK if you want). But I want to keep these kind of changes out of the core files (ie extend in hot-deploy)

> Extend primary keys
> -------------------
>
>                 Key: OFBIZ-5648
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5648
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 11.04, SVN trunk, Release Branch 12.04, Release Branch 13.07
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>              Labels: entity, extend
>         Attachments: ModelEntity.java.patch, test.entity-extend.patch
>
>
> 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
> {code}
> // this will always be true for now as extend-entity fielsd are always nonpks
> {code}
> 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
> # Apply the test.entity-extend.patch
> # 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.
> # 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
> # Apply the ModelEntity.java.patch, clean-data load-demo, restart
> # 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



--
This message was sent by Atlassian JIRA
(v6.2#6252)