Package | Description |
---|---|
org.nutz.dao.entity |
抽象的Pojo配置信息描述
|
org.nutz.dao.entity.annotation |
各种Dao相关的注解
|
org.nutz.dao.impl.entity |
Pojo配置信息实现
|
org.nutz.dao.impl.entity.field | |
org.nutz.dao.impl.entity.info |
Class and Description |
---|
ColType
描述一个数据库字段类型
|
Class and Description |
---|
ColType
描述一个数据库字段类型
|
Class and Description |
---|
EL
为 '@Next' 以及 '@Prev' 注解声明的可执行 EL。
|
SQL
为 '@Next' 以及 '@Prev' 注解声明的可执行 SQL。
|
Class and Description |
---|
ColType
描述一个数据库字段类型
|
Class and Description |
---|
ColDefine
给出字段的更加精确的数据库类型描述,方便 Dao 创建数据表
|
Column
声明一个 Java 字段是否有对应的数据库字段
|
Comment
可以为表或字段添加相应的注释。
动态表名暂时不支持
|
Default
为一个字段声明默认值。 Nutz.Dao 在发现一个字段没有被设值时,会用你声明的这个 默认值填出字段,再执行操作。
|
Id
标识当前字段为一个 ID。 这字段的必须为整型(int,long,short,byte),否则 会在解析 POJO 时主动抛出异常。
|
Many
声明一条一对多映射,这个声明需要你输入三个参数,其中一个是可选的:
target: 你的这个字段对应的实体类。通常,这个类得是你的字段的一个子类或者实现类。或者它能够顺利的通过 Nutz.castor
转换成 你的字段
field: 参考字段(或者说是"关联字段")名,同 '@One' 不同,这个参考字段是 target 类中的字段。如果它为空串,则将映射目标实体全部记录
key: [可选] 如果本注解声明在一个 Map 字段上,这个参数指明了你的 POJO 哪个字段可以作为 key
Can be Many: |
ManyMany
本注解声明了多对多的关联,它需要 5 个参数,其中一个是可选的:
target: 对应的实体类名,意义和@One 和 @Many 一样
relation: 中间的关联表的名称,这个关联表也可以动态的,详细请参看 '@Table' 的描述
from: 表示关联表中哪个字段代表主对象
to: 表示关联表中哪个字段代表 target 对象
key: [可选] 同 '@Many' 中的同名参数意义一样。
你还需要知道:
两个对象的关联是通过 Id 或者 Name 来关联的,关联的优先级为 @Id <-> @Id @Id <-> @Name @Name <-> @Id @Name <-> @Name |
Name
声明一个字段为 Name
|
Next
对象插入后的自动执行
|
One
在一个字段上声明一条一对一映射,这个声明需要你输入两个参数:
target: 你的这个字段对应的实体类。通常,这个类得是你的字段的一个子类或者实现类。或者它能够顺利的通过 Nutz.castor
转换成 你的字段
field: 参考字段名,这个字段为对应对象的 Java 字段名称。
|
PK
声明了一个 POJO 的主键。
|
Prev
对象插入前的自动执行
|
Readonly
一个标识,声明了本注解的字段,在插入和更新时,会被忽略。
|
Table
声明的一个 POJO 所对应的数据表名。
|
TableIndexes
声明一组数据表的索引
|
TableMeta
通过一个 Json 字符串,为这个数据对象进行更详细的设置。
|
View
一个实体,应该从何处获取。默认的,会从 '@Table' 注解声明的表名获取。
|
Copyright © 2017. All rights reserved.