This annotation creates come objectd like DAO, Repository, ViewModel and User Interfase with full navigation of CRUD operations of this entity.

The ObjectGeneratorCE annotation is used to automatically generate essential components of an entity, such as DAO, Repository, ViewModel, and the User Interface (UI). It provides full CRUD (Create, Read, Update, Delete) operations for the associated entity, including navigation support. This annotation simplifies the process of creating common components for an entity and ensures that all necessary infrastructure is automatically generated without needing to manually write boilerplate code.

Parameters:

Example Usage:

@ObjectGeneratorCE(
    type = GeneratorType.BOTH,
    hasDetails = true,
    label = "User Profile",
    beforeSave = "validateUserProfile",
    beforeDelete = "archiveUserProfile"
)
@Entity (.......)
data class UserProfile(
    @PrimaryKey(autoGenerate = true)
    override var id: Long,
    override var date: Long,
    override var name: String,
    override var isMarkedForDeletion: Boolean,
    ................
): CommonReferenceEntity(id,date,name,isMarkedForDeletion), Parcelable  {
    // Entity properties and methods
}

How It Works:

  1. Entity Generation: When the ObjectGeneratorCE annotation is applied to a class, it triggers the automatic generation of all the necessary components:
  2. Custom Functions: The beforeSave and beforeDelete hooks allow you to inject custom logic before performing these operations. This is useful for adding validation, logging, or any pre-processing needed before saving or deleting the entity.
  3. Full CRUD Operations: With this annotation, the entity can immediately support full CRUD functionality, including automatic UI for viewing, editing, and deleting instances of the entity.
  4. Customization: You can fine-tune the behavior of the generated components by adjusting the parameters of the annotation. For example, you can decide whether the UI should be generated, whether detailed views are needed, and whether any hooks should be used.

[ObjectGeneratorCE](https://wool-fontina-39f.notion.site/ObjectGeneratorCE-1bbac9e71431806189c7f8b20d76aea4)

ObjectGeneratorCE