Difference between revisions of "Developing Plug-Ins - IModelFactory"

From iDempiere en
Line 12: Line 12:
  
 
=The workflow=
 
=The workflow=
 +
After creating the plug-in and setting its dependencies, click on New>New>Others and select "Component Definition" from the Plug-in Development section.
 +
 +
 +
 +
Click on next. Select your plug-in project and chose a file name and a general name. We often use "defaultmodelfactory.xml" and "my.domain.model.factory" for the filename/name but every other name is okay too. You don't need to set the class name yet because we haven't implemented one. Click on finish.

Revision as of 09:18, 4 March 2013

Goal of this tutorial

The goal of this tutorial is to show, how you use the IModelFactory service in you plug-in project. The reason why you want to use the model factory service is, that you can provide your own model for custom tables and iDempiere will make use of them. Also if you want to use the Query class, it is necessary to provide your own models. Otherwise, a Query will return a "GenericPO" instead of your model class.

Prerequisites

Before you start this tutorial, you should take a look at the follwing tutorials:

The workflow

After creating the plug-in and setting its dependencies, click on New>New>Others and select "Component Definition" from the Plug-in Development section.


Click on next. Select your plug-in project and chose a file name and a general name. We often use "defaultmodelfactory.xml" and "my.domain.model.factory" for the filename/name but every other name is okay too. You don't need to set the class name yet because we haven't implemented one. Click on finish.

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