Web / Apache OFBiz Interview questions
What is the difference between GenericValue and GenericEntity?
GenericEntity is the base class providing the core map-like behavior for any entity instance - field storage, equality, and comparison against a ModelEntity definition.
GenericValue extends GenericEntity and adds the behavior used day to day: a reference back to its delegator, so you can call .getRelated(...) to traverse relations, lazy-load related records, and perform entity operations directly from the object (store(), remove()) rather than only through static delegator calls.
In practice almost all application code works with GenericValue - GenericEntity is mostly an internal implementation detail that GenericValue builds on.
More Related questions...