patch to add first and max results, and named parameters for queries
Opened this issue · 5 comments
GoogleCodeExporter commented
Hi, using annotations, I've been able to extend the excellent work you all
have done with this nascent project.
I've attached a patch allowing someone to annotate a named query, first
with @AnnotatedNamedQuery ( to notify the finder that we'll be using named
queries with named parameters )
Each parameter can then have @NamedParameter, @FirstResult, or @MaxResults.
FirstResult and MaxResult are expected to be integers, and NamedParameter
has a single value() that takes the name of the parameter.
so an example would be :
@AnnotatedNamedQuery List<Employee> findEmployeesInVacationPeriod(
@NamedParameter('startDate') Date startDate, @NamedParameter('endDate')
Date endDate, @FirstResults first, @MaxResults max ) ;
The error checking is still pretty nominal ( and I'm not the best at
annotations/generics ), but hopefully you or others will find this useful.
Original issue reported on code.google.com by aadi.des...@gmail.com
on 15 May 2007 at 10:57
GoogleCodeExporter commented
sorry, patch added
Original comment by aadi.des...@gmail.com
on 15 May 2007 at 10:58
- Added labels: ****
- Removed labels: ****
Attachments:
GoogleCodeExporter commented
This is cool and I will take a look. Thanks!
Original comment by RichardH...@gmail.com
on 6 Jun 2007 at 9:16
- Added labels: ****
- Removed labels: ****
GoogleCodeExporter commented
I took a look. Very nice.
Original comment by RichardH...@gmail.com
on 6 Sep 2007 at 3:52
- Added labels: ****
- Removed labels: ****
GoogleCodeExporter commented
[deleted comment]
GoogleCodeExporter commented
I really like this feature. Is there any chance for this to be added?
Now, I use my own branch of Crank with this patch added. :)
Original comment by peter.we...@gmail.com
on 26 Jan 2009 at 7:01
- Added labels: ****
- Removed labels: ****