You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Kenshi Toriumi (Created) (JIRA)" <ji...@apache.org> on 2011/10/23 07:19:32 UTC

[jira] [Created] (DBUTILS-82) Change BeanListHandler to be able to handle to list of the bean's super class or interface

Change BeanListHandler to be able to handle to list of the bean's super class or interface
------------------------------------------------------------------------------------------

                 Key: DBUTILS-82
                 URL: https://issues.apache.org/jira/browse/DBUTILS-82
             Project: Commons DbUtils
          Issue Type: Improvement
    Affects Versions: 1.3
            Reporter: Kenshi Toriumi
            Priority: Minor


BeanListHandler handles to list of the bean class itself only.
If want list of the bean's base class or interface, two steps of cast are needed.
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<BeanImpl> blh = new BeanListHandler<BeanImpl>(BeanImpl.class);
List<BeanImpl> beanImplList = queryRunner.query(sql, blh);
List<Bean> beanList = (List<Bean>) ((List<?>) beanImplList);
{code}

I want to change BeanListHandler to  be able to handle to list of the bean's super class or interface;
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<Bean> blh = new BeanListHandler<Bean>(BeanImpl.class);
List<Bean> beanList = queryRunner.query(sql, blh);
for (Bean bean : beanList) {
}
{code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DBUTILS-82) Change BeanListHandler to be able to handle to list of the bean's super class or interface

Posted by "Kenshi Toriumi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBUTILS-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenshi Toriumi updated DBUTILS-82:
----------------------------------

    Attachment: DBUTILS-82.patch

patch for this issue
                
> Change BeanListHandler to be able to handle to list of the bean's super class or interface
> ------------------------------------------------------------------------------------------
>
>                 Key: DBUTILS-82
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-82
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Kenshi Toriumi
>            Priority: Minor
>         Attachments: DBUTILS-82.patch
>
>
> BeanListHandler handles to list of the bean class itself only.
> If want list of the bean's base class or interface, two steps of cast are needed.
> {code:borderStyle=solid}
> // Bean is super class or interface of BeanImpl
> BeanListHandler<BeanImpl> blh = new BeanListHandler<BeanImpl>(BeanImpl.class);
> List<BeanImpl> beanImplList = queryRunner.query(sql, blh);
> List<Bean> beanList = (List<Bean>) ((List<?>) beanImplList);
> {code}
> I want to change BeanListHandler to  be able to handle to list of the bean's super class or interface;
> {code:borderStyle=solid}
> // Bean is super class or interface of BeanImpl
> BeanListHandler<Bean> blh = new BeanListHandler<Bean>(BeanImpl.class);
> List<Bean> beanList = queryRunner.query(sql, blh);
> for (Bean bean : beanList) {
>     assert bean == null || bean.getClass() == BeanImpl.class;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (DBUTILS-82) Change BeanListHandler to be able to handle to list of the bean's super class or interface

Posted by "Kenshi Toriumi (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBUTILS-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kenshi Toriumi updated DBUTILS-82:
----------------------------------

    Description: 
BeanListHandler handles to list of the bean class itself only.
If want list of the bean's base class or interface, two steps of cast are needed.
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<BeanImpl> blh = new BeanListHandler<BeanImpl>(BeanImpl.class);
List<BeanImpl> beanImplList = queryRunner.query(sql, blh);
List<Bean> beanList = (List<Bean>) ((List<?>) beanImplList);
{code}

I want to change BeanListHandler to  be able to handle to list of the bean's super class or interface;
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<Bean> blh = new BeanListHandler<Bean>(BeanImpl.class);
List<Bean> beanList = queryRunner.query(sql, blh);
for (Bean bean : beanList) {
    assert bean == null || bean.getClass() == BeanImpl.class;
}
{code}


  was:
BeanListHandler handles to list of the bean class itself only.
If want list of the bean's base class or interface, two steps of cast are needed.
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<BeanImpl> blh = new BeanListHandler<BeanImpl>(BeanImpl.class);
List<BeanImpl> beanImplList = queryRunner.query(sql, blh);
List<Bean> beanList = (List<Bean>) ((List<?>) beanImplList);
{code}

I want to change BeanListHandler to  be able to handle to list of the bean's super class or interface;
{code:borderStyle=solid}
// Bean is super class or interface of BeanImpl
BeanListHandler<Bean> blh = new BeanListHandler<Bean>(BeanImpl.class);
List<Bean> beanList = queryRunner.query(sql, blh);
for (Bean bean : beanList) {
}
{code}


    
> Change BeanListHandler to be able to handle to list of the bean's super class or interface
> ------------------------------------------------------------------------------------------
>
>                 Key: DBUTILS-82
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-82
>             Project: Commons DbUtils
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Kenshi Toriumi
>            Priority: Minor
>
> BeanListHandler handles to list of the bean class itself only.
> If want list of the bean's base class or interface, two steps of cast are needed.
> {code:borderStyle=solid}
> // Bean is super class or interface of BeanImpl
> BeanListHandler<BeanImpl> blh = new BeanListHandler<BeanImpl>(BeanImpl.class);
> List<BeanImpl> beanImplList = queryRunner.query(sql, blh);
> List<Bean> beanList = (List<Bean>) ((List<?>) beanImplList);
> {code}
> I want to change BeanListHandler to  be able to handle to list of the bean's super class or interface;
> {code:borderStyle=solid}
> // Bean is super class or interface of BeanImpl
> BeanListHandler<Bean> blh = new BeanListHandler<Bean>(BeanImpl.class);
> List<Bean> beanList = queryRunner.query(sql, blh);
> for (Bean bean : beanList) {
>     assert bean == null || bean.getClass() == BeanImpl.class;
> }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira