I searched for this topic in the forums, but couldn't find it. I also apologize for probably not using the correct terminology. Here it goes.
I have a couple of beans as:
and then in my sql I have something to likeCode:BeanA { String a; BeanB beanB; } BeanB { String b; }
And then I am using the query method for jdbcTemplate as follows:Code:SELECT a as a, b as beanB.b FROM XYZ;
However, the String b, which is inside BeanB, which is inside BeanA does not get populated.Code:List<BeanA> beanAList = getJdbcTemplate().query( <SELECT SQL GOES HERE>, new BeanPropertyRowMapper<BeanA (BeanA.class) );
Is there a special implementation of BeanPropertyRowMapper that permits column names to be mapped to beans inside beans using the dot notation? I could definitely look into writing a custom bean property row mapper, but I find it rather incredulous that the Spring team did not implement this by default. I feel like I am missing something.
Can someone please guide?
Thanks.
Abhishek Goel


Reply With Quote
