之间有什么区别这两条线中的访问用户
public interface PostRepository extends JpaRepository<Post, Long> {
List<Post> findByUser_Id(Long id);
}
和
public interface PostRepository extends JpaRepository<Post, Long> {
List<Post> findByUserId(Long id);
}
所以我编辑我的问题可以更清楚并得到一个很好的响应,所以这是我的领域类用户和后和我有关系 @ManyToOne 后类。
域
...
public class Post implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
...
和
...
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
...