huntlabs / hunt-entity

An object-relational mapping (ORM) framework for D language (Similar to JPA / Doctrine), support PostgreSQL and MySQL.

Home Page:https://www.huntlabs.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add @Created and @Updated annotations to Entity define

zoujiaqing opened this issue · comments

Add annotations:

  1. Created : Get the timestamp automatically at creation time.
  2. Updated : Get the timestamp automatically at update time.

Sample code:

import hunt.entity;

class User
{
    @PrimaryKey
    int id;

    string name;

    @Created
    int created;

    @Updated
    int updated;
}