Java新手,问一个问题,想请大佬能为我解惑。
在用三层架构从数据库查询数据时发现一个问题,从product表只需要查询一行数据,用list封装结果传递到域里会报错,用javabean却可以。从category表查询多行数据用java bean会报错,用list却可以。我现在对javabean和list的使用有点闷了。![](https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK/tb/editor/images/client/image_emoticon9.png)
![](https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK/tb/editor/images/client/image_emoticon66.png)
![](https://imgsa.baidu.com/forum/w%3D580/sign=1e195371b60e7bec23da03e91f2eb9fa/737bfa1f3a292df5c7e6eb6bb2315c6034a87338.jpg)
在用三层架构从数据库查询数据时发现一个问题,从product表只需要查询一行数据,用list封装结果传递到域里会报错,用javabean却可以。从category表查询多行数据用java bean会报错,用list却可以。我现在对javabean和list的使用有点闷了。
![](https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK/tb/editor/images/client/image_emoticon9.png)
![](https://gsp0.baidu.com/5aAHeD3nKhI2p27j8IqW0jdnxx1xbK/tb/editor/images/client/image_emoticon66.png)
![](https://imgsa.baidu.com/forum/w%3D580/sign=1e195371b60e7bec23da03e91f2eb9fa/737bfa1f3a292df5c7e6eb6bb2315c6034a87338.jpg)