You have a table in a database based on the following class (the table's name and fields are the same):
Java
@Entity
public class Car {
@Id
@GeneratedValue
private long id;
private String model;
private int year;
// constructor, getters, setters
}
Kotlin
@Entity
class Car (
@Id
@GeneratedValue
var id: Long = 0,
var model: String = "",
var year: Int = 0
)
How can you delete all the cars of a certain year of production? Choose all possible options.
Java
1) long deleteCarByYear(int year)
2) long deleteByYear(int year)
3) void deleteByYear(int year)
4) void deleteByYear(String year)
5) List<Car> deleteByYear(int year)
6) void removeByYear(int year)
Kotlin
1) deleteCarByYear(year: Int): Long
2) deleteByYear(year: Int): Long
3) deleteByYear(year: Int)
4) deleteByYear(year: String)
5) deleteByYear(year: Int): List<Car>
6) removeByYear(year: Int)