Make a module for ADempiere that's forward compatible with iDempiere

From iDempiere en

You as a developer might be maintaining both iDempiere and ADempiere systems. Modules in ADempiere are handled differently than in iDempiere and depending on how they are written they might not be forward compatible unless code is rearranged.

To prevent double work we can make sure that modules are forward compatible by following these guide lines:

Create new entities in your own defined entity types

By habit it might be tempting to put your model classes in org.compiere.model, org.adempiere.model etc and in some cases it might be a good idea. However, with the plugin architecture you're exporting packages and if you add another module that exports the same package as some other package already exports there might be trouble. iDempiere's base packages already export org.compiere.model for instance.

So, the safest way is to put your entity classes in their own unique package.

You do this as follows:

  • As SuperUser, go to Entity type in the application menu.
  • Create a new entity type
  • Set the ModelPackage to your unique package
  • Run Generate model for your packages

Naming convention of classes

Generate model will create entity / model-classes for your tables.

If the table is called

xx_my_table

the resulting classes will be named

I_XX_My_Table.java
X_XX_My_Table.java

If you want to create your own overridden class it must then be named

MXXMyTable.java

If you follow these rules, it will be easy to migrate the classes to the iDempiere architecture.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.