Files
ofbiz-framework/framework/entity
Jacques Le Roux 0bd14b407c A patch from Bob Morley "When an entityModel has a field marked as a primary key, it should also be set to NotNull" (https://issues.apache.org/jira/browse/OFBIZ-3154) - OFBIZ-3154
We were doing some work with the ModelField and noticed that when a field is marked as a primary key it can still have its "NotNull" property set to "false" (the default). Because we were doing work based on if a field was nullable it was causing a bug on primary keys. The suggestion is to set NotNull = "true" when a field is marked as a primary key. This should have no impact to current code as (in most places) a redundant check was being done (see creation of tables where it will add "NOT NULL" based on both isNotNull and isPk – ideally it should be just based on the former).

This change makes minor modifications to two files ModelField and ModelEntity. ModelField.setIsPk() will call setIsNotNull(true) when the primary key indicator is true. ModelEntity will call field.isNotNull = true when it is reading the primary key elements in the entity definition.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@835303 13f79535-47bb-0310-9956-ffa450edef68
2009-11-12 08:49:27 +00:00
..