Package rs.etf.sab.operations
Interface DistrictOperations
public interface DistrictOperations
-
Method Summary
Modifier and TypeMethodDescriptionint
deleteAllDistrictsFromCity
(String nameOfTheCity) Delete all district from given city.boolean
deleteDistrict
(int idDistrict) Delete district by primary key.int
deleteDistricts
(String... names) Delete districts by name.Get primary keys of all districts in the system.getAllDistrictsFromCity
(int idCity) Get primary keys of all districts from the given.int
insertDistrict
(String name, int cityId, int xCord, int yCord) Insert new district with given name, the city which that district is a part of, and coordinates of the district.
-
Method Details
-
insertDistrict
Insert new district with given name, the city which that district is a part of, and coordinates of the district.- Parameters:
name
- - district name.cityId
- - primary key of the city.xCord
- - x cord ("longitude") given in km.yCord
- - y cord ("latitude") given in km.- Returns:
- new row's primary key on success, or -1 on failure.
-
deleteDistricts
Delete districts by name.- Parameters:
names
- - names of the districts to be deleted.- Returns:
- number of deleted records.
-
deleteDistrict
boolean deleteDistrict(int idDistrict) Delete district by primary key.- Parameters:
idDistrict
- - primary key of the district to be deleted.- Returns:
- success of operation.
-
deleteAllDistrictsFromCity
Delete all district from given city.- Parameters:
nameOfTheCity
- - the name of the city, containing all district that should be deleted.- Returns:
- number of deleted records.
-
getAllDistrictsFromCity
Get primary keys of all districts from the given. -
getAllDistricts
Get primary keys of all districts in the system.
-