6.10.2021 |

Using related JPA entities without loading them

In case you need a referenced object but don't want to load it from the database.

em.getReference(Account.class, accountId)

getReference allows you to get an instance from the EntityManager, whose state may be lazily fetched, but is not loaded from the database right away.

Thx to https://stackoverflow.com/questions/12828919/how-do-i-save-an-entity-with-foreign-key-without-loading-the-related-entity-in-j

Zur Übersicht
Jan Sauer

Mehr vom Devsquad...

Umut Tufanoglu

Generate a QR Code in one line using qrcode.show

Dennis Hundertmark

Lighthouse Treemap

Hallo, ich bin Jörg Herbst!

Ich bin der CEO von newcubator und freue mich über jede Nachricht!

* Pflichtfeld