![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
jpa
o_瓜田李下_o
这个作者很懒,什么都没留下…
展开
-
springboot jpa 单表操作
springboot jpa单表操作**********************************相关接口基础接口public interface Repository <T, ID>public interface CrudRepository<T, ID> extends Repository<T, ID>pub...原创 2019-09-10 14:57:16 · 381 阅读 · 0 评论 -
springboot jpa 单表动态查询
springbootjpa 单表动态查询*******************************示例:根据name,age查询student,name或者age可能为null******************dao层public interface StudentRepository extends JpaRepository<Student...原创 2019-09-10 16:00:02 · 634 阅读 · 0 评论 -
springboot jpa 单表聚合
springbootjpa单表聚合*******************************************相关接口******************************public interface EntityManager Query createNativeQuery(String var1); Query ...原创 2019-09-10 16:56:16 · 570 阅读 · 0 评论 -
springboot jpa 一对一级联查询
springbootjpa一对一级联查询****************************相关注解@OneToOne:一对一级联注解public @interface OneToOne { Class targetEntity() default void.class; CascadeType[] cascade() default {};...原创 2019-09-10 17:17:29 · 1450 阅读 · 11 评论 -
springboot jpa 一对多、多对一级联查询
springbootjpa一对多、多对一级联查询*************************相关注解public @interface OneToMany { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType f...原创 2019-09-10 17:50:52 · 2015 阅读 · 0 评论 -
springboot jpa 多对多级联查询
sprngbootjpa多对多级联查询****************************相关注解public @interface ManyToMany { Class targetEntity() default void.class; CascadeType[] cascade() default {}; FetchType fe...原创 2019-09-10 18:06:00 · 1856 阅读 · 0 评论 -
springboot jpa 多表操作
springbootjpa多表操作**************************************jpa使用nativeQuery实现多表联查,多表聚合示例:schoolstudentschool:id,namestudent:id、name、age、school_id多表联查:id,name,age,schoolName,自定义类Stu...原创 2019-09-10 18:21:33 · 1008 阅读 · 0 评论 -
springboot jpa 命名规范
springbootjpa命名规范说明:jpa方法可以find/findBy、read/readBy、query/queryBy、get/getBy开头,属性之间用关键词间隔;***********************************示例:findByUserAddressId()处理的时候,若UserAddressId不为pojo的属性...原创 2019-09-10 21:01:13 · 700 阅读 · 0 评论 -
springboot jpa 分布式主键
springboot jpa分布式主键*****************************相关注解@Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)@Repeatabl...原创 2019-09-10 21:55:41 · 605 阅读 · 0 评论 -
springboot jpa 根据表生成类
springboot jpa根据表生成类********************************操作步骤:file ====》projectstructure ====》modules ====》jpa ====》ok database ====》+ ====》mysql ====》配置数据源 ...原创 2019-09-10 22:16:47 · 494 阅读 · 0 评论 -
springboot jpa 创建、更新时间戳
springbootjpa创建、更新时间戳****************************相关注解@ValueGenerationType( generatedBy = CreationTimestampGeneration.class)@Retention(RetentionPolicy.RUNTIME)@Target({ElementType...原创 2019-09-13 15:09:13 · 2273 阅读 · 0 评论 -
springboot jpa 乐观锁
springboot jpa乐观锁**************************相关注解@Target({ElementType.METHOD, ElementType.FIELD})@Retention(RetentionPolicy.RUNTIME)public @interface Version {}*******************...原创 2019-09-13 15:39:05 · 444 阅读 · 0 评论