William

Results 9 issues of William

Hi, I found that there may be some minor improvements about annotations in your code. By adding @Transactional at the class level, many important aspects such as transaction propagation can...

Hi, I found that there may be some minor improvements about annotations in your code. A Spring bean in the service layer should be annotated using @Service instead of @Component...

Hi, I found that there may be some minor improvements about annotations in your code. A Spring bean in the persistence layer should be annotated using @Repository instead of @Component...

你好,我发现你的代码可能有一些小的改进。 通过在类级别添加@transactional,可以自动处理事务传播等许多重要方面。 它可以将您的服务包装在一个生成的代理中,该代理加入一个活动事务或启动一个新事务,并在您的方法执行后提交或回滚事务。 基于上面提到的优点,我建议您在类级别添加@transactional 注解。 希望我的建议有用!

将类注解由@component修改为@service,该类主要承担业务逻辑处理,所以使用@service注解更为合适,@Service是一种特殊的@Component,对于主要处理业务逻辑的Bean,使用@Service注解更好

Hi, I found that there may be some minor improvements about annotations in your code. It would be more appropriate to add @Repository annotation at the class level. The @Repository...

将注解@Component修改为注解@Service,该类在系统中主要负责业务逻辑的处理,使用@Service注解更合适

该类主要对数据库中的数据进行操作,增加注解@Transactional可以更方便地实现回滚等操作,会更好

您好,我发现您的代码中的注释可能有一些小的改进。 服务层中的 Spring bean 应该使用 @service 而不是 @component 注解进行注解。 @service注解是@component在服务层的特化。 通过使用专门的注解,可以得到更优的效果。 首先,它们被视为 Spring bean,其次,您可以放置该层所需的特殊行为。 为了更好地理解和维护大型应用程序,@service 是更好的选择。