Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • You could try something like Coollection. It's not Linq for Java, but it's close. Commented Aug 11, 2016 at 21:14
  • I'm kind of curious, how does a stored procedure about retrieving inventory items have anything to do with how MANY somebody can order? Not seeing certain items I can understand, but that... Commented Aug 12, 2016 at 12:48
  • @JDT: Inventory can be restricted such that a person in a given group may only be allowed to order a certain number of items (usually over a sliding window, say 3 items every 30 days or something). As mentioned, this sproc's only ever gotten more complicated over time, hence my question. Commented Aug 12, 2016 at 16:43
  • 1
    A dynamic SQL approach is not necessarily bad, if the creation code is well structured and maintainable. Why is the SQL creation done in a stored procedure, instead of a java function or class at the client side? Moreover, if you are going to move the place where the filtering occurs from the server to the client, your program will always need to transfer all inventory items over the network, for every query, and then might throw away lots of that data again. If that is the case, it might become a performance problem. Commented Aug 13, 2016 at 12:01
  • 1
    ... moreover, if the SQL creation would a Java program, you could easily unit test it (without the database). Just write tests which compares the generated queries for different parameter sets with a list of expected queries. Commented Aug 13, 2016 at 12:06