From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-29 04:10:09
|
Hi everyone, I just committed to CVS an experimental version of the new pageable queries API. Its not quite finished yet, since it doesn't support named query parameters + setFirstResult() is not yet implemented. Also, I had always intended to refactor a bunch of code from RelationalDatabaseSession (now renamed SessionImpl) to QueryImpl but I havn't done that yet, since it wasn't the path of least resistence. I still need to do it at some stage - SessionImpl is an abominably huge class. However, it would be cool if people could check it out and give criticism. A question I have is about the naming of this method on the Query interface public void setEntity(int position, Object val); (Used to bind an entity object to a JDBC parameter.) The word "entity" is used liberally in the documentation, but not in the actual code and never in the API. The method on class Hibernate that gets an entity type is called "association". However "setAssociation" sounds wrong. 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 was never particularly happy with the using the word "entity" for what I call "persistent object" in my head (and in the implementation code, generally). However there *does* need to be a way to distinguish between entity and value objects since both really fit the description "persistent object". The JDO spec calls these things "first class objects" and "second class objects" which is okay, but not really that evocative. Can anyone think of a better name? TIA Gavin oh, PS, is "bindParameter, bindInteger" better than "setParameter, setInteger"? I chose the latter to be consistent with JDBC.... |