GenerateModel Class

305 views
Skip to first unread message

yuanaw

unread,
Mar 29, 2023, 4:13:44 AM3/29/23
to iDempiere
Dear All

Hope you all well & healthy

in ADempiere, we have todo GenerateModel, to update the class after for e.g add new field to existing window
GenerateModel class extending PO
GenerateModel class acts as converter that maps AD objects to java classes for easier programming

What about iDempiere?
is it needed todo GenerateModel like in ADempiere?

Many Thanks 🙏

Heng Sin Low

unread,
Mar 29, 2023, 4:27:53 AM3/29/23
to idem...@googlegroups.com
Yes, same.

In Eclipse, Run Eclipse Application > model.generator


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/d68b112e-f614-4b1f-b1a1-38367b102bafn%40googlegroups.com.

yuanaw

unread,
Mar 29, 2023, 4:49:29 AM3/29/23
to iDempiere
i will try both

Many Thanks Hengsin for fast Response 🙏

yuanaw

unread,
Mar 30, 2023, 12:10:14 AM3/30/23
to iDempiere
Dear Hengsin 🙏

what should I enter in the field that marked with red square?

MODEL GENERATOR_2023-03-30_11-07-00.png

Thanks Hengsin 🙏

On Wednesday, March 29, 2023 at 3:27:53 PM UTC+7 hengsin wrote:

Heng Sin Low

unread,
Mar 30, 2023, 12:18:26 AM3/30/23
to idem...@googlegroups.com
Table Name is hmm ... Table Name
Table Entity  Type: D for Dictionary, U for user customization. Usually D for core table and U for your custom table.
Column Entity Type: Usually you can leave this empty.

yuanaw

unread,
Mar 30, 2023, 12:25:38 AM3/30/23
to iDempiere
Dear Hengsin  🙏

For Table Name, instead for specific Table Name Like AD_Role
Can we use % for All Table For Table Entity D or U?

ID MODEL GENERATOR FORM_2023-03-30_11-25-01.png

Thanks Hengsin 🙏

yuanaw

unread,
Mar 30, 2023, 12:41:38 AM3/30/23
to iDempiere
Thanks Hengsin  🙏

i have done it for specific table & all table, and no error

Many Thanks Hengsin 🙏🙏🙏

On Thursday, March 30, 2023 at 11:18:26 AM UTC+7 hengsin wrote:

yuanaw

unread,
Apr 12, 2023, 6:36:15 AM4/12/23
to iDempiere
Dear Hengsin

When i try to run again Model Generator

it's show error
Any missing something that i have do?

ERROR MESSAGE:
******************

Apr 12, 2023 5:31:53 PM org.adempiere.base.AnnotationBasedProcessFactory lambda$0
INFO: DefaultAnnotationBasedProcessFactory loaded 78 classes in 1.033s
Apr 12, 2023 5:31:53 PM org.adempiere.base.AnnotationBasedColumnCalloutFactory lambda$0
INFO: DefaultAnnotationBasedColumnCalloutFactory loaded 2 classes in 1.057s
17:31:53.676 Adempiere.startup: iDempiere(r) Release 11_2022-12-24 -Smart Suite ERP, CRM and SCM- (c) 1999-2023 iDempiere(r); Implementation: iDempiere - Supported by iDempiere community [1]
17:31:53.677-----------> Ini.loadProperties: /opt/idempiere-valid-until-20230412-1615/idempiere.properties not found [1]
17:31:53.705 Ini.loadProperties: /opt/idempiere-valid-until-20230412-1615/idempiere.properties #26 [1]
17:31:53.903===========> CConnection.setAttributes:  - java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 0 [1]
java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 0
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at org.compiere.db.CConnection.setAttributes(CConnection.java:934)
at org.compiere.db.CConnection.get(CConnection.java:62)
at org.compiere.Adempiere.startup(Adempiere.java:562)
at org.adempiere.base.ModelGeneratorApplication.start(ModelGeneratorApplication.java:43)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

!SESSION 2023-04-12 17:31:50.003 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.18
java.vendor=Red Hat, Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application org.adempiere.base.ModelGeneratorApplication
Command-line arguments:  -application org.adempiere.base.ModelGeneratorApplication -data /opt/eclipse-jee-2022-03-R-linux-gtk-x86_64/eclipse-workspace/runtime-model.generator -dev file:/opt/eclipse-jee-2022-03-R-linux-gtk-x86_64/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/model.generator/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog

!ENTRY org.eclipse.osgi 4 0 2023-04-12 17:31:54.100
!MESSAGE Application error
!STACK 1
org.adempiere.exceptions.AdempiereException: Could not execute /opt/idempiere-valid-until-20230412-1615/org.adempiere.server-feature/utils.unix/getVar.sh
at org.compiere.util.Ini.runCommand(Ini.java:865)
at org.compiere.util.Ini.getVar(Ini.java:808)
at org.compiere.db.CConnection.get(CConnection.java:66)
at org.compiere.Adempiere.startup(Adempiere.java:562)
at org.adempiere.base.ModelGeneratorApplication.start(ModelGeneratorApplication.java:43)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Caused by: java.lang.Exception: Variables file does not exist
at org.compiere.util.Ini.runCommand(Ini.java:861)
... 17 more
An error has occurred. See the log file
/opt/eclipse-jee-2022-03-R-linux-gtk-x86_64/eclipse-workspace/.metadata/.plugins/org.eclipse.pde.core/model.generator/1681295510315.log.

******************

MODEL GENERATOR_2023-04-12_17-34-36.png

MODEL GENERATOR_2023-04-12_17-35-08.png

Many Thanks


On Thursday, March 30, 2023 at 11:18:26 AM UTC+7 hengsin wrote:

Heng Sin Low

unread,
Apr 12, 2023, 7:30:04 AM4/12/23
to idem...@googlegroups.com
it can't find the .idvar file. try remove idempiere.properties and run setup again.

yuanaw

unread,
Apr 12, 2023, 10:37:41 PM4/12/23
to iDempiere
Dear Hengsin  🙏

i have try run setup again
and i have try to copy  idempiere.properties from $IDEMPIERE_HOME to $IDEMPIERE_REPOSITORY (Rename first existing idempiere.properties in $IDEMPIERE_REPOSITORY to idempiere.propertiesORI)
but i still get the error  🙆‍♂️ 🙏🙏🙏

any suggestion?

LOG FILE_2023-04-13_09-29-55.png

ECLIP CONSOLE_2023-04-13_09-31-00.png

IDEMPIERE HOME REPOSITORY_2023-04-13_09-33-36.png



Many Thanks 🙏🙏🙏

yuanaw

unread,
Apr 12, 2023, 11:43:29 PM4/12/23
to iDempiere
Dear Hengsin  🙏

i'm so sorry Hengsin 🙏🙏🙏 ... i wrong choose the method of install

INSTRUCTION_2023-04-13_10-36-45.png

MODEL GENERATOR SUCCESS_2023-04-13_10-39-17.png

Many Thanks Hengsin 🙏🙏🙏


On Wednesday, April 12, 2023 at 6:30:04 PM UTC+7 hengsin wrote:

Heng Sin Low

unread,
Apr 13, 2023, 12:52:19 AM4/13/23
to idem...@googlegroups.com
Remove idempiere.properties and run setup again. DONT copy idempiere.properties from somewhere else.

yuanaw

unread,
Apr 13, 2023, 3:01:35 AM4/13/23
to iDempiere
Dear Hengsin  🙏

Yes, you right " DONT copy idempiere.properties from somewhere else"
it file have to be created by it self process

Many Thanks Hengsin  🙏

Jesús Castillo

unread,
Apr 13, 2023, 11:15:30 AM4/13/23
to idem...@googlegroups.com
Hi,

Did you run server.install first?
 
Atte: Jesus Castillo.

Mailtrack Remitente notificado con
Mailtrack
04/12/23, 09:45:54 AM

yuanaw

unread,
Apr 13, 2023, 7:11:50 PM4/13/23
to iDempiere
Hi  Jesus Castillo  🙏

i never run  server.install
where i can find server.install?
before i try, can you explain to me, what  server.install do?
is it will overwrite the Execution that i have done before?

Generate Model_2023-04-14_05-50-09.png

Below are what i have been done

WHAT I HAVE BEEN DONE_2023-04-14_06-08-48.png

Many Thanks  Jesus Castillo  🙏

Jesús Castillo

unread,
Apr 14, 2023, 9:13:17 AM4/14/23
to idem...@googlegroups.com
Sorry, I tried to say install.app.
 
Atte: Jesus Castillo.

Mailtrack Remitente notificado con
Mailtrack
04/14/23, 09:12:24 AM

yuanaw

unread,
Apr 15, 2023, 12:37:40 AM4/15/23
to iDempiere
Dear Hengsin & All  🙏

Sorry i i disturb you again  🙏

When i try open my dev source again
and i not yet make any changes to mau source and eclipse
and when i try again to run model.generator in eclipse
i get the following error messages

Can you Guide me how to resolve this and not to show it error again in the next?

ERROR GENERATE MODEL AGAIN_2023-04-15_11-30-55.png

When i try update maven
The error is gone
but when i try to run again model.generator in eclipse
the error raise again

Many Thanks  Hengsin & All  🙏

On Thursday, April 13, 2023 at 11:52:19 AM UTC+7 hengsin wrote:

yuanaw

unread,
Apr 15, 2023, 12:58:52 AM4/15/23
to iDempiere
When i try to run again "mvn verify"
i get the same error  🙏

RUN MVN VERIFY_2023-04-15_11-57-16.png

Many Thanks  Hengsin & All  🙏

Heng Sin Low

unread,
Apr 15, 2023, 1:05:23 AM4/15/23
to idem...@googlegroups.com
That's due to you have run generate model for all tables, you should just run for your custom tables or table you have change.

For those model class that you have accidentally overwritten ( for e.g, I_AD_UserMail), right click on the file (or folder) and choose replace with head revision to restore the original file(s).

yuanaw

unread,
Apr 15, 2023, 1:38:56 AM4/15/23
to iDempiere
Dear Hengsin  🙏

Yes...you right  🙏
i have try it again
When i fill all table , the error raise again

Sorry Hngsing 🙏
Thanks Hengsin 🙏

yuanaw

unread,
Apr 15, 2023, 1:46:19 AM4/15/23
to iDempiere
Dear Hengsin  🙏

For our own created table 
what type of Table entity Type should be filled?

And for System Table/Application Dictionary that already exist, that have change by us for example added new filed
what type of Table entity Type should be filled?

The list of Entity Type:
A - Application modifications
C - iDempiere Ownership ** System Maintained **
CUST - Other Application Customizations
D - Application Dictionary Ownership ** System Maintained **
EE01 - Libero Manufacturing covers all manufacturing activity within the various types of production environments
EE02 - Libero Human Resource & Payroll
EE04 - e-Evolution Libero Global Tax Management
EE05 - Replication Data
EXT - Application Extensions
U - User maintained modifications
WSTORE - Web Store
XX - Other Application Extensions

Thanks  Hengsin  🙏

On Saturday, April 15, 2023 at 12:05:23 PM UTC+7 hengsin wrote:

yuanaw

unread,
Apr 15, 2023, 1:48:14 AM4/15/23
to iDempiere
ENTITY TYPE_2023-04-15_12-47-45.png

On Saturday, April 15, 2023 at 12:05:23 PM UTC+7 hengsin wrote:

Heng Sin Low

unread,
Apr 15, 2023, 1:49:12 AM4/15/23
to idem...@googlegroups.com
We usually just use U

yuanaw

unread,
Apr 15, 2023, 2:10:48 AM4/15/23
to iDempiere
What U is used for table below or we use another Entity Type?:
* We have created by our self e.g c_mom_head & c_mom_line?
* and for e.g we modified System AD Table like AD_Role?

Thanks  Hengsin  🙏

Heng Sin Low

unread,
Apr 15, 2023, 2:12:51 AM4/15/23
to idem...@googlegroups.com
Yes, you can use U for anything you added.

yuanaw

unread,
Apr 15, 2023, 2:16:34 AM4/15/23
to iDempiere
Thanks  Hengsin  🙏 🙏 🙏

Carlos Antonio Ruiz Gomez

unread,
Apr 15, 2023, 7:41:56 AM4/15/23
to idem...@googlegroups.com
Hi yuanaw,

In my case I prefer not to generate model for my new columns in core tables.

I access my custom columns using the get_Value methods




Am 15.04.23 um 08:16 schrieb yuanaw:
Thanks  Hengsin  🙏 🙏 🙏

On Saturday, April 15, 2023 at 1:12:51 PM UTC+7 hengsin wrote:
Yes, you can use U for anything you added.

On Sat, Apr 15, 2023 at 2:10 PM yuanaw <yuana...@gmail.com> wrote:
What U is used for table below or we use another Entity Type?:
* We have created by our self e.g c_mom_head & c_mom_line?
* and for e.g we modified System AD Table like AD_Role?

Thanks  Hengsin  🙏

On Saturday, April 15, 2023 at 12:49:12 PM UTC+7 hengsin wrote:
We usually just use U

On Sat, Apr 15, 2023 at 1:48 PM yuanaw <yuana...@gmail.com> wrote:
On Saturday, April 15, 2023 at 12:05:23 PM UTC+7 hengsin wrote:
That's due to you have run generate model for all tables, you should just run for your custom tables or table you have change.

For those model class that you have accidentally overwritten ( for e.g, I_AD_UserMail), right click on the file (or folder) and choose replace with head revision to restore the original file(s).

On Sat, Apr 15, 2023 at 12:58 PM yuanaw <yuana...@gmail.com> wrote:
When i try to run again "mvn verify"
i get the same error  🙏



Many Thanks  Hengsin & All  🙏

On Saturday, April 15, 2023 at 11:37:40 AM UTC+7 yuanaw wrote:
Dear Hengsin & All  🙏

Sorry i i disturb you again  🙏

When i try open my dev source again
and i not yet make any changes to mau source and eclipse
and when i try again to run model.generator in eclipse
i get the following error messages

Can you Guide me how to resolve this and not to show it error again in the next?



When i try update maven
The error is gone
but when i try to run again model.generator in eclipse
the error raise again

Many Thanks  Hengsin & All  🙏

On Thursday, April 13, 2023 at 11:52:19 AM UTC+7 hengsin wrote:
Remove idempiere.properties and run setup again. DONT copy idempiere.properties from somewhere else.

On Thu, Apr 13, 2023 at 10:37 AM yuanaw <yuana...@gmail.com> wrote:
Dear Hengsin  🙏

i have try run setup again
and i have try to copy  idempiere.properties from $IDEMPIERE_HOME to $IDEMPIERE_REPOSITORY (Rename first existing idempiere.properties in $IDEMPIERE_REPOSITORY to idempiere.propertiesORI)
but i still get the error  🙆‍♂️ 🙏🙏🙏

any suggestion?









Many Thanks 🙏🙏🙏

Many Thanks


On Thursday, March 30, 2023 at 11:18:26 AM UTC+7 hengsin wrote:
Table Name is hmm ... Table Name
Table Entity  Type: D for Dictionary, U for user customization. Usually D for core table and U for your custom table.
Column Entity Type: Usually you can leave this empty.

On Thu, Mar 30, 2023 at 12:10 PM yuanaw <yuana...@gmail.com> wrote:
Dear Hengsin 🙏

what should I enter in the field that marked with red square?



yuanaw

unread,
Apr 15, 2023, 7:44:50 AM4/15/23
to iDempiere
Hi Carlos Ruiz...Thanks for your Reply  🙏

Does your tips is for core tables or for Our own customs tables?

Many Thanks Carlos Ruiz 🙏

Heng Sin Low

unread,
Apr 15, 2023, 7:54:00 AM4/15/23
to idem...@googlegroups.com
For core tables.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

yuanaw

unread,
Apr 15, 2023, 9:33:52 AM4/15/23
to iDempiere
Many  Thanks Hengsin & Carlos Ruiz 🙏
Reply all
Reply to author
Forward
0 new messages