You need to remember that if the mapped entities are truly set to be lazy, then:
Quote:
it feels like a lot of unnessecary work to get a whole
object just to get an ID
is a little misleading. What actually happens is that Hibernate generates a proxy for these entity instances; they know about their PK value, but none of the other data has been loaded from the database (until you actually try to access it). Calling myEntity.getId() *does not* force Hibernate to load the entity from the database (remember that the constructed proxy already knows about its id value).
HTH