Prev Next

Web / Apache OFBiz Interview questions

How do you define a new entity in OFBiz?

Defining a new entity is a declarative, config-first process:

  1. Add an <entity> element to your component's entitydef/entitymodel.xml with a unique entity-name, its field elements, and a prim-key.
  2. Add any relation elements pointing to related entities (for foreign keys).
  3. 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.
  4. Optionally seed reference data for it in a matching data/*SeedData.xml file.

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.

New entities are declared in:
After adding an entity definition, the table is created by:

More Related questions...

What is Apache OFBiz? What are the main business applications that ship with Apache OFBiz? What is the Entity Engine in OFBiz? What is the Service Engine in OFBiz? What is a component in OFBiz? What is the purpose of the Screen Widget? What is the purpose of the Form Widget? What is a delegator in OFBiz? What is a dispatcher in OFBiz? What is entitymodel.xml used for? How do you define a new entity in OFBiz? How do you define a new service in OFBiz? What is Mini-language (simple-method) in OFBiz? What build tool does OFBiz use? What are the default admin login credentials for a fresh OFBiz install? What are Security Groups and Security Permissions in OFBiz? What is the Party component used for? What are seed, seed-initial, and demo data types in OFBiz? Why does OFBiz use its own Entity Engine instead of a plain JPA/Hibernate ORM? How does a Service Engine call differ from a direct Java method call? What is the difference between SECA and EECA? Explain the execution flow of a synchronous service call in OFBiz? Explain the execution flow of an asynchronous service call in OFBiz? Explain the internal working of the Screen Widget rendering pipeline? What is the difference between a static entity and a view-entity? How does OFBiz cache entity data, and when should the cache be cleared? What is the difference between GenericValue and GenericEntity? Why would you use a dynamic-view-entity instead of a predefined view-entity? Explain the lifecycle of a sales order in OFBiz from cart to fulfillment? How does OFBiz support multi-tenancy? What is the difference between writing a service in Mini-language versus Groovy? How does OFBiz's Job Scheduler execute persisted and recurring jobs? What is the difference between OFBiz's ModelEntity and ModelService? How do you troubleshoot a service invocation failure using OFBiz logs? Explain the internal working of the OFBiz security/permission checking framework? What is the difference between a screen decorator and a plain screen definition? When should you use a stored/Java service instead of a Mini-language service? How does Distributed Cache Clear (DCC) keep entity caches consistent across a cluster? What happens internally when you run "gradlew cleanAll loadAll"? What is the difference between the plugins directory and the older hot-deploy directory? How can you optimize entity queries in OFBiz for large datasets? What is the difference between the Order Manager and Accounting components? Explain the execution flow of an inbound web request through OFBiz's Control Servlet? How do Entity ECAs enforce validation rules without modifying core Java code? Why doesn't OFBiz ship with a traditional MVC framework like Spring MVC? How can you extend an existing core entity without modifying core framework files? What is the difference between the Fluid and default (Bootstrap-based) OFBiz themes? How does OFBiz integrate with Apache Solr for product search? What is the difference between OFBiz's REST/SOAP service export and calling a service internally? How do you troubleshoot a permission denied error accessing a screen?
Show more question and Answers...


Comments & Discussions