Skip to content

Instantly share code, notes, and snippets.

@goyuninfo
Created March 4, 2021 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyuninfo/b5e829b86642d46866edab81d43a7364 to your computer and use it in GitHub Desktop.
Save goyuninfo/b5e829b86642d46866edab81d43a7364 to your computer and use it in GitHub Desktop.
//Using read-only in a JPA Query
import org.eclipse.persistence.config.HintValues;
import org.eclipse.persistence.config.QueryHints;
query.setHint(QueryHints.READ_ONLY, HintValues.TRUE);
//Using read-only in a @QueryHint Annotation
import org.eclipse.persistence.config.HintValues;
import org.eclipse.persistence.config.QueryHints;
@QueryHint(name=QueryHints.READ_ONLY, value=HintValues.TRUE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment