Skip to content

EntityBase vs Entity

yigit edited this page Aug 21, 2012 · 2 revisions

One important customization we made is to separate most of auto-generated entity code into a separate class + let code generator decide where to put them.

Here is how it works: When there is an entity Foo, it creates an abstract class FooBase which uses protected properties for its fields (instead of private) and classic getters and setters with the default constructors. The Foo class itself only has two constructors matching super (FooBase).

You still need KEEP SECTIONS for custom code inside Foo but this separation makes it cleaner. It also lets overriding getters and setters for fields for custom implementations.

for examples, checkout Customer and CustomerBase for samples

Clone this wiki locally