小编Ang*_*gel的帖子

Android Studio库依赖项 - 所有选项都是Alpha版本

当我尝试将库添加到我的Android Studio项目时,它们都是最新的alpha版本而不是当前版本.它不会让我通过他们的直接名称安装非alpha版本.Android Studio项目添加库依赖项的屏幕截图

android android-studio android-studio-import

7
推荐指数
1
解决办法
1210
查看次数

SpringBoot JPA接口的save()和delete()不适用于ArrayList或Long

我正在关注使用SpringBoot 1.3的教程。我正在使用SpringBoot 2.0的最新版本。我正在创建REST API。我需要帮助使1.3代码适应2.0规范,save()并且delete()现在期望对象超过long ids。我该如何重写接受接口long id' and 'ArrayList

现在的代码如下:

基础对象

@Entity
public class HotelBooking {

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private long id; // could be Long

private String hotelName;
private double pricePerNight;
private int nbOfNights;

public HotelBooking(){} 

public HotelBooking(String hotelName, double pricePerNight, int nbOfNights) {
    this.hotelName = hotelName;
    this.pricePerNight = pricePerNight;
    this.nbOfNights = nbOfNights;
}
// getters omitted
}
Run Code Online (Sandbox Code Playgroud)

介面

@Repository
public interface BookingRepository extends JpaRepository<HotelBooking, Long> {
data/jpa/docs/2.1.0.M1/reference/html/
    List<HotelBooking> findByPricePerNightLessThan(double …
Run Code Online (Sandbox Code Playgroud)

java interface spring-mvc spring-data-jpa spring-boot

3
推荐指数
1
解决办法
5356
查看次数