symfony3 yml配置文件详解
2017-06-29 11:14
183 查看
AppBundle\Entity\BlogComment: //映射实体
type: entity //类型
repositoryClass: AppBundle\Repository\BlogCommentRepository //生成repository类
table: blog_comment //对应表
indexes: //外键信息
blog_comment_post_id_idx: //外键名
columns: //列
- post_id //外键字段名
id: //主键配置
id: //字段名
type: bigint //字段类型
nullable: false //是否为null
options: //选项
unsigned: false //没有设置unsigned属性
id: true
generator: //配置auto_increment等属性
strategy: IDENTITY
fields: //字段配置
author: //字段名
type: string //字段类型
nullable: false //是否为null
length: 20 //字段长度
options:
fixed: false
content:
type: text
nullable: false
length: null
options:
fixed: false
createdAt:
type: datetime
nullable: false
column: created_at
manyToOne: //多对一关系
post: //表名
targetEntity: BlogPost //映射实体
cascade: { } //外键约束配置
fetch: LAZY
mappedBy: null
inversedBy: null
joinColumns:
post_id: //关联字段别名
referencedColumnName: id //关联字段映射到post表主键名
orphanRemoval: false
lifecycleCallbacks: { } //对数据库操作的回调设置
type: entity //类型
repositoryClass: AppBundle\Repository\BlogCommentRepository //生成repository类
table: blog_comment //对应表
indexes: //外键信息
blog_comment_post_id_idx: //外键名
columns: //列
- post_id //外键字段名
id: //主键配置
id: //字段名
type: bigint //字段类型
nullable: false //是否为null
options: //选项
unsigned: false //没有设置unsigned属性
id: true
generator: //配置auto_increment等属性
strategy: IDENTITY
fields: //字段配置
author: //字段名
type: string //字段类型
nullable: false //是否为null
length: 20 //字段长度
options:
fixed: false
content:
type: text
nullable: false
length: null
options:
fixed: false
createdAt:
type: datetime
nullable: false
column: created_at
manyToOne: //多对一关系
post: //表名
targetEntity: BlogPost //映射实体
cascade: { } //外键约束配置
fetch: LAZY
mappedBy: null
inversedBy: null
joinColumns:
post_id: //关联字段别名
referencedColumnName: id //关联字段映射到post表主键名
orphanRemoval: false
lifecycleCallbacks: { } //对数据库操作的回调设置
相关文章推荐
- 详解Spring Boot加载properties和yml配置文件
- SpringBoot开发详解(三)--SpringBoot配置文件YML注意事项
- SpringBoot开发详解(三)--SpringBoot配置文件YML注意事项
- twemproxy的配置文件nutcracker.yml详解
- SpringBoot开发详解(三)--SpringBoot配置文件YML注意事项
- SpringBoot开发详解(三)--SpringBoot配置文件YML注意事项
- docker-compose.yml 配置文件编写详解
- Docker Compose 配置文件 Docker-Compose.yml 文件详解
- Linux下DNS配置文件详解
- notes.ini文件的配置参数详解
- Struts配置文件详解
- 详解yum的配置文件
- struts2的struts.properties配置文件详解
- Linux网络服务配置文件详解
- 详解yum的配置文件
- struts2的struts.properties配置文件详解
- Log4j配置文件详解
- struts的配置文件详解
- ubuntu中vsftp的配置文件详解
- .NET配置文件解析过程详解