Web / Apache OFBiz Interview questions
How do you define a new entity in OFBiz?
Defining a new entity is a declarative, config-first process:
- Add an
<entity>element to your component'sentitydef/entitymodel.xmlwith a uniqueentity-name, itsfieldelements, and aprim-key. - Add any
relationelements pointing to related entities (for foreign keys). - Run the data-load/table-creation task (for example
gradlew loadAll, or the WebTools "Create/Update All" utility) so the Entity Engine generates the actual database table from the new definition. - Optionally seed reference data for it in a matching
data/*SeedData.xmlfile.
No SQL DDL is written by hand - the table, columns, and indexes are all derived from the XML model, and the same definition works unchanged across Derby, PostgreSQL, MySQL, or Oracle.
More Related questions...