The MyBatis Interface is defined as follows:
@TypeProviderFor(MybatisMapper)
interface DBMapper extends MybatisMapper {
List<ReferenceItem> listReferences(String type)
int addReferenceItem(ReferenceItem newItem)
int saveReferenceItem(ReferenceItem item)
int badOrders(int id)
ReferenceItem getReferenceItem(int id, String type)
List getBadOrders(int carId)
List<ReportingMark> listReportingMarks()
int addReportingMark(ReportingMark mark)
List<ViewCar> listCarsForViewing()
int addRRCar(RRCar)
RRCar getRRCar(int id)
int updateCar(RRCar)
int addInspection(Inspection inspection)
int addBadOrder(BadOrder badOrder)
}
The controller in question has the following snippet:
if (name.equals("MaintenanceWindow")) {
List<ReferenceItem> areas = dbService.getReferenceList("CAR_AREA")
areas.each {
view.carArea.items.add(new ObsReference(id: it.id, typeVal: it.typeName))
}
view.carArea.getSelectionModel().select(0)
model.selectedCarArea.bind(view.carArea.getSelectionModel().selectedIndexProperty())
model.datePerformed.set(LocalDate.now())
dbService.getBadOrders(model.carId)
model.currentTime.set(LocalTime.now().format(DateTimeFormatter.ofPattern("kk:mm")))
List<BOViewModel> badOrderedCars = dbService.getBadOrders(carId)
log.debug("the list of bad ordered cars is {}", badOrderedCars)
runInsideUI( {
view.badOrderedCars.getItems().remove(0, view.badOrderedCars.getItems().size())
log.debug("adding a bad ordered car {}", it)
badOrderedCars.each {view.badOrderedCars.items.add(it)}
})
}
The first dbService reference ( dbService.getReferenceList("CAR_AREA")) runs fine, the second (dbService.getBadOrders(carId)) responds with ") Caused by: groovy.lang.MissingMethodException: No signature of method: com.spw.rr.DBService.badOrderResults() is applicable for argument types: (java.lang.Integer) values: [3]" For the life of me, I can't see the difference between the first definition and the second. Anyone have thoughts?
I need to remember the sequence -- define the method in the service, define what the service calls in both the Interface and the XML. I was skipping a step and didn't rememeber it.
The code in the first snippet is the interface definition. I didn't post the code from the service (dbService reference) -- that's where the method needs to be defined.