annotations for meta setup

Issue #2 resolved
David Rundle created an issue
@mapClass("models.todo")
class Todo {

    @mapId()
    id: string;

    @map("models.task")
    tasks: Task[];

    @map()
    owner: Person;

    @map()
    created: Date;

    @map()
    description: string;

    misc: string; //ignored as there is no annotation.
}

class TodoSetup implements Setup {
    configure(builder: Builder): void {
        builder.addType(Todo);
    }
}

notes:

  • should minimise magic strings
  • the array, should convert into .addProperty("tasks", "models.task[]")
  • the owner, should convter to .addProperty("owner", "models.Person")

Comments (2)

  1. Log in to comment