スプリングboot注記の使用について


シーンの再現:
String sql = "SELECT s.begin_time,s.end_time FROM SCHEDULE s WHERE s.class_id = ? AND s.lesson_id = ?";

ScheduleAddVo scheduleAddVo = myJdbcTemplate.queryForObject(sql,new Object[]{classId,lessonId},new BeanPropertyRowMapper<>(ScheduleAddVo.class));

原因探究:springbootを使用して実装する上で注意しなければならない点::エンティティクラスがspringbootを使用してテストを行う際に常にエラーを報告しなければならない
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.aixuexi.xiuchun.test.PageListMongodbTest': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.gaosi.api.xiuchun.service.RequestTraceService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

解决方法:解决方法service実装に注釈@comを加える.alibaba.dubbo.config.annotation.Service
dao層のクラスに注釈@Reposityが付けられていない可能性もあります
switch case break基本構文規則
私たちがdao層でクエリー・データベースを書くとき、先生はいろいろな異常を報告しやすいです.
org.springframework.jdbc.IncorrectResultSetColumnCountException: Incorrect column count: expected 1, actual 5
         
return myJdbcTemplate.query(sql,new Object[]{type,classType,lessonId},new BeanPropertyRowMapper<>(SearchQuestionDto.class));  

BeanPropertyRowMapper           list
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

3つの可能性のある異常は、1つ目はdao層が注釈を付けていないこと、2つ目はserviceの注釈ガイドパッケージエラー、3つ目はdubboのserviceが登録依存バージョンのエラーを報告していないため、一般的にpomである.xmlファイルのエラー