Announcement Announcement Module
Collapse
No announcement yet.
BeanPropertyRowMapper extension Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BeanPropertyRowMapper extension

    Hello
    new 2.5 convenient class org.springframework.jdbc.core.BeanPropertyRowMappe r (actually it's super
    org.springframework.jdbc.core.AbstractBeanProperty RowMapper) lacks support for Y/N(or T/F) boolean mapping (like hibernate's CharBooleanType).
    All column-bean field mapping logic is concentrated in single method AbstractBeanPropertyRowMapper.doMapRow() that make it hard to extend.
    It would be nice to see some extension points in this class in future releases.

    Thank you

  • #2
    Posting here won't give you much results, create a JIRA issue if you want some additions/changes.

    Comment


    • #3
      Juergen corrected this issue in SPR-4355. Template method for value retrieval will appear in 2.5.2.

      Many thanks, Juergen!

      Comment


      • #4
        boolean properties are not populating correctly.

        Hi All,

        I'm executing below query in spring2.5

        Code:
          SELECT  emp.* FROM employee emp WHERE emp.emp_id = ?		
        			
        			List<?> result = this.jdbcTemplate.query(
        					l_sb.toString(),
        					new Object[]{new Long(emp_id)},new BeanPropertyRowMapper(EmployeeBean.class));
        			
        			empBean = (EmployeeBean) result.get(0);	
        
        logger.info("Inside employeeInfo() emp_enrolled:"+empBean.isEnrolled());
        In EmployeeBean, 'enrolled' property is defined as boolean.

        In database 'enrolled' column is having 'Y/N' values. The current record which I feached from database is having value 'Y' but while displaying this value it is showing 'false'??

        Can anyone please let me know, how to correct this problem for boolean properties.

        Thanks in advance.

        Regards,
        Sharath.

        Comment

        Working...
        X