views:

255

answers:

2

Hello,

I'm new to JPA and I'd like to know if it is possible to stream data from a result set, I mean I do not want to wait that the query is performed to start dealing with first results, for instance in the case of a batch.

Is there any possibility using the JPA API or any community adopted workaround ? Eventually using a feature of a JPA implementation ?

Thank you for your answers

Araviski

+1  A: 

Is using @javax.persistence.PostLoad annotation viable option for you? This way you can hook up action to the moment when given object is created from the data store. I am not sure if this is exactly what you are looking for.

jarekrozanski
+1  A: 

For obvious reasons the "master" select must finish before anything can be done on the result set. I'm not sure what you're trying to achieve here... Perhaps you need to make some fields lazy in order to get first result faster and fetch details as you process them?

Konrad Garus