
|
If you were logged in you would be able to see more operations.
|
|
EJB Cartridge
Created: 24/Aug/07 05:21 PM
Updated: 11/Mar/08 10:11 AM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
None
|
|
There's something wrong in the way DAOs query method are generated with EJB3 cartridge. All exceptions thrown by Query are wrapped in a DaoException, including NoResultException. So that when you call a DAO method and it throws an exception, you have no easy way to know if the exception is thrown because there is no result (which could be something expected) or because there is an error in the request, a problem with the database, etc ... It would be better to do like Hibernate cartridge does : if there is no result for the query, the method returns null. For other exceptions, it throws an exception.
|
|
Vance, I wrote this patch. Please tell me if you think it is OK.
There was an error with the patch I supplied : it worked with a SELECT query but not with an UPDATE one. The code catching NoResultException was generated for both kinds of queries so I had a compilation failure with "return null". I added a new patch to generate NoResultException catch code only for select queries and no more for update ones.
|
|