Developing an application for freight, in fact, this application to work with the database. There are tables for entering information. So, it is necessary to realize the possibility of canceled perfect actions on database objects (CRUD operations) as in word and other similar applications.
I use hibernate with annotations, now every change happens within a separate session as I understand it. Example:
Cell properties in the tableView controller:
columnDateEnd.setOnEditCommit((TableColumn.CellEditEvent<Trip, Date> t) -> { Trip trip = t.getTableView().getItems().get(t.getTablePosition().getRow()); trip.setDateEnd(t.getNewValue()); tripService.save(trip); }); TripService simply calls the save repository method:
@Repository public interface TripRepository extends JpaRepository<Trip,Long> { }