Norqy / warp-persist

Automatically exported from code.google.com/p/warp-persist
0 stars 0 forks source link

Arrays and Collections as parameters for DF #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Dynamic Finder methods don't support Arrays or Collections.
At least for Hibernate, we should use Query.setParameterList instead of
always using Query.setParameter like we do now.

Reported here:
http://groups.google.com/group/warp-core/browse_thread/thread/147c15f70aabd6c9?h
l=en

Original issue reported on code.google.com by robbie.v...@gmail.com on 24 Aug 2008 at 4:01

GoogleCodeExporter commented 9 years ago

Original comment by robbie.v...@gmail.com on 21 Dec 2008 at 5:39

GoogleCodeExporter commented 9 years ago
r264 has some findings related to JPA. There is only one API to specify 
parameters
with JPA (setParameter) and it "should" convert parameters. In any case, it 
seems
like you HAVE to use @Named parameters and can't use arrays. So if people want 
to use
IN(...) with JPA, they have to use regular collections and @Named. I don't think
we're doing anything wrong and the type conversion seems to be vague (or absent,
even) in the JPA spec. So basically, it's a JPA issue.

We can fix the Hibernate problem though. I'll have a look at that next.

Original comment by robbie.v...@gmail.com on 22 Dec 2008 at 11:22

GoogleCodeExporter commented 9 years ago
Fixed in r265 for Hibernate. Summary:
- Hibernate: @Named params now support arrays and collections
- JPA: @Named params already supported collections and don't support arrays.
- Positional params never support collections or arrays.

Original comment by robbie.v...@gmail.com on 22 Dec 2008 at 11:44

GoogleCodeExporter commented 9 years ago
As I said on a different thread--let's not support arrays at all. This would be 
nice and clean. Besides who is 
actually using arrays?

Original comment by dha...@gmail.com on 23 Dec 2008 at 1:00

GoogleCodeExporter commented 9 years ago
I like varargs. :)

Original comment by robbie.v...@gmail.com on 23 Dec 2008 at 1:01

GoogleCodeExporter commented 9 years ago
for DF? That even possible?

Original comment by dha...@gmail.com on 23 Dec 2008 at 1:14

GoogleCodeExporter commented 9 years ago
Varargs get javac'd to arrays, so if we support arrays we support varargs.

Original comment by robbie.v...@gmail.com on 23 Dec 2008 at 1:18