Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在类中实现行映射器的Spring管理bean注入_Java_Json_Spring_Postgresql_Inject - Fatal编程技术网

Java 在类中实现行映射器的Spring管理bean注入

Java 在类中实现行映射器的Spring管理bean注入,java,json,spring,postgresql,inject,Java,Json,Spring,Postgresql,Inject,我有一个类BusinessRowMapper,它实现了RowMapper来将PostgresJSONB对象转换为Java对象 BusinessRowMapper implements RowMapper<PersonDetails> 您可以将PersonUtility类定义为在类上添加@component的Springbean 然后,您可以在BusinessRowMapper @Component public class BusinessRowMapper implem

我有一个类BusinessRowMapper,它实现了RowMapper来将PostgresJSONB对象转换为Java对象

BusinessRowMapper implements RowMapper<PersonDetails>

您可以将
PersonUtility
类定义为在类上添加
@component
的Springbean

然后,您可以在
BusinessRowMapper

@Component 
    public class BusinessRowMapper implements RowMapper<PersonDetails> { 

    @Autowired 
    private PersonUtility utils; 


    ... 


    } 
@组件
公共类BusinessRowMapper实现了RowMapper{
@自动连线
个人效用效用;
... 
} 

不起作用。还有,如何从-getNamedParameterJdbcTemplate().query(ConstantsV4.RETRIEVE_PERSON_DETAIL_query,params,new BusinessRowMapper(实用工具))调用这个映射器bean;
getNamedParameterJdbcTemplate().query(
                        ConstantsV4.RETRIEVE_PERSON_DETAIL_QUERY, params,
                        new BusinessRowMapper(utility));
@Component 
    public class BusinessRowMapper implements RowMapper<PersonDetails> { 

    @Autowired 
    private PersonUtility utils; 


    ... 


    }