From: Urberg, J. <ju...@ve...> - 2002-07-29 12:27:01
|
>> I suppose a way to dodge this issue would be to have a single method public void setObject(int position, Object val); which checks if val is an entity, a persistent enum or Serializable and uses whichever Type is appropriate but I would only go this way if people think that would be a better API for other reasons..... (I think its slightly inferior) << 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. When I was about to execute the SQL, I'd just loop thru the Collection and call "setObject" to bind the parameters. I can see doing the same sort of thing with Hibernate's query language and would hate to have to keep track of whether a parameter is an entity or not so I can call the correct binding function. Regards, John Urberg |