美文网首页
springboot

springboot

作者: EnjoyWT | 来源:发表于2018-07-12 16:30 被阅读7次

    @Entity:表示这是一个实体 (修饰model类)

    @Table:指定Entity所要映射的数据库表,指定表名称,如果不指定,就是类名的首字母小写(修饰model类 样例: @Table(name = "user") )

    @Id:对应数据库中的ID,主键

    @Column:对应数据库表中普通属性

    @GeneratedValue:指定主键的生成策略,根据不同的数据库自动选择

    @EnableJpaRepositories(basePackages="com.etc.*"):扫描指定的包下的Respository

    @EntityScan(basePackages="com.etc.*") :扫描指定包下的实体

    @ComponentScan(basePackages="com.etc.*"):指定扫描的包,否则只扫描此类所在的包

    @Modifying:完成修改操作(不包括新增)

    @Transactional:事务注解,要么全部成功,要么全部失败

    相关文章

      网友评论

          本文标题:springboot

          本文链接:https://www.haomeiwen.com/subject/zscrpftx.html