Hibernate
This is version . It is not the current version, and thus it cannot be edited.
Back to current version   Restore this version

Key / Id Property ermitteln#

Session session = (Session)entityManager.getDelegate();
ClassMetadata metadata = session.getSessionFactory().getClassMetadata(type);
String keyName = metadata.getIdentifierPropertyName();
Class<?> keyType = metadata.getIdentifierType().getReturnedClass();