on some condition, record insert by direct sql missing UUID

Description

it's better to add generate_uuid() to default logic of UU column and delete manual insert uuid from code

but at moment just follow old method by add generate_uuid on insert command

Environment

None

Activity

Show:
Heng Sin Low
May 2, 2020, 2:12 PM

Yeah, that default sounds fine to me.

It is only use when the java code is not doing it so that doesn’t sounds like any sort of conflict to me - we can keep what’s in java now and add default clause for UU column (should be mandatory with default).

Hiep Lq
May 3, 2020, 5:43 AM

we can add default to all uuid column (with mandatory) and don't change java code. because value setter from java code override default value. add to all uuid column get more advance
example: table ad_column somewhere on code now already handle uuid by "insert ad_column (ad_column_uuid)" but on future maybe insert ad_column forget setter uuid then default value will handle it

Carlos Ruiz
May 3, 2020, 11:19 AM

From what I understand, if we plan to make all _UU columns mandatory with default generate_uuid(), then I think the ticket would require the following changes:

  • change the UUIDGenerator process to generate the new columns with these new properties

  • I think it's better also if the UUIDGenerator process can check the old _UU generated columns and change them accordingly

  • a migration script that changes all the actual columns (this can be generated automatically after the UUID Generator does the work proposed in second bullet

  • change the MColumn.setSmartDefaults and Callout_AD_Column.columnName to set these properties too

Hiep Lq
May 3, 2020, 5:48 PM

thanks for point out that.

just saw "we can keep what’s in java now" save us from log migrate script for UUID issue

Carlos Ruiz
October 18, 2020, 9:43 AM

Copying here the list of classes discovered in IDEMPIERE-811:

Found that some classes are doing direct INSERT INTO without filling the UU column, like:

org.compiere.model.MDocType -> AD_Document_Action_Access
org.compiere.model.MLanguage -> tableName
org.compiere.model.MPInstanceLog -> AD_PInstance_Log
org.compiere.model.MProcessPara -> AD_Process_Para_Trl
org.compiere.model.MRole -> AD_Window_Access AD_Process_Access AD_Form_Access AD_WorkFlow_Access AD_Document_Action_Access
org.compiere.model.TranslationTable -> trltable
org.compiere.print.PrintUtil -> AD_PrintForm
org.compiere.process.FactReconcile -> Fact_Reconciliation T_Reconciliation
org.compiere.process.ProcessInfoUtil -> AD_PInstance_Log
org.compiere.process.AcctSchemaDefaultCopy -> M_Product_Acct ... and samely the other account default copy processes
org.compiere.process.ImportProduct -> M_Product_PO
org.compiere.process.InventoryCountCreate -> M_StorageOnHand
org.compiere.process.M_PriceList_Create -> M_ProductPrice
org.compiere.process.SynchronizeTerminology -> AD_ELEMENT_TRL
org.adempiere.webui.dashboard.DPFavourites -> AD_TreeBar
org.adempiere.webui.ValuePreference -> AD_Preference
... there are more ...

Assignee

Unassigned

Reporter

Hiep Lq

Labels

Tested By

None

Priority

Major
Configure