I'm currently evaluating hibernate for accessing a non-trivial legacy database. One important feature of the datamodel is a embedded model-definition within the database itself. So for any column in a table there is additional metadata in another table. In order to prevent loading all this metadata beforehand, I wonder if I could access only the required data when I actually need it. So I could implement a usertype for the "enhanced" properties and access the table containing the additional data on-demand. Consequently I must perform another query when I'm already processing a query result. Is this feature supported by hibernate? If so, will session- and secondlevel cache play along? Must I use a second session for this, or could i reuse the current session? BTW: This scheme is definitely limited to two parallel queries, it does not have to be arbitrary recursive...
Thanks!
|