实体定义
jmms支持通过java class来定义实体。
下面以User
实体具体说明如何进行定义:
- 创建实体类
User.java
:
import leap.lang.enums.Bool;
import leap.orm.annotation.Column;
import leap.orm.annotation.Id;
import leap.orm.annotation.Table;
@Table("user")
public class User {
@Id
protected String id;
@Column(length = 200, nullable = Bool.TRUE)
protected String firstName;
@Column(length = 200, nullable = Bool.TRUE)
protected String lastName;
...
}
- 创建
app/entities/User.json
:
{
"className": "com.example.project.User"
}