1. Problems arising
I am executing the mytest program. Yes, I reported an error.
1. Dao layer interface
1 int insertSale(Sale sale);
2. Service layer
1 @Override 2 public void buy(Integer goodsId, Integer nums) { 3 4 // Record sales information and add records to the sale table 5 .... 6 saleDao.insertSale(sale); 7 }
The above error will be reported after running the program
2. Error reason
The reason for this error is that the service layer buy() method does not return a value. And we defined the dao layer method is to return int, there will be the following prompt
3. Solution
This is a problem with the Dao layer. The Dao layer is modified as follows:
1 void insertSale(Sale sale);
Similar Posts:
- [Solved] Mybatis error: attempted to return null from a method with a primitive return type (int)
- [Solved] Spark Streaming:updateStateByKey is not applicable for the arguments…
- Iview Error: [Vue warn]: Error in render: “TypeError: ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot] is not a function”
- assignment makes pointer from integer without a…
- Idea Error: No provider available from registry 127.0.0.1:2181 for service
- invalid conversion from ‘void* (*)()’ to ‘void* (*)(void*)’
- How to Solve MyBatisPlus Error: Failed to process, please exclude the tableName or statementId
- [Solved] Java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double
- Consider defining a bean of type ‘xxx’ in your configuration. Autowired(required=true)
- [Solved] An error occurred when paddlepaddle iterated data: typeerror: ‘function’ object is not iterative