Skip to content

Add getReference(detachedEntity) to EntityManager #489

Closed
@gavinking

Description

A very useful operation that we recently added in Hibernate is this one:

<T> T getReference(T object);

It's job is to turn a reference to a detached entity into a reference associated with the persistence context.

It's just a shortcut way to write:

em.getReference(entity.getClass(),entity.getId())

I know it seems like a completely trivial little thing, but sometimes conveniences like this can be very helpful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status

      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions