From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-29 13:23:04
|
>I would vote for this option. In the past, I've had to write a lot of >code that dynamically built JDBC. As the SQL query string was built, >I would collect parameter values in a seperate Collection. I think we already sort of address this by having a generic method public void setParameter(int loc, Object value, Type type); As long as you also collect a list of types, you are fine.... We can't provide a truly generic method because theres too much ambiguity. eg. a java.lang.Long could by Hibernate's "long" type or Hibernate's "serializable" type. A java.util.Date could be "date", "time", timestamp", "serializable" or even, in theory, an entity. I suppose we could provide one which does a best guess ... so it would pick a java.lang.Long as "long" but its still problematic for Date..... P.S. I have finished implementing named query parameters + setFirstResult() and its all in CVS to try out..... |