Example usage for org.hibernate Session getIdentifier

List of usage examples for org.hibernate Session getIdentifier

Introduction

In this page you can find the example usage for org.hibernate Session getIdentifier.

Prototype

Serializable getIdentifier(Object object);

Source Link

Document

Return the identifier value of the given entity as associated with this session.

Usage

From source file:org.wintersleep.wicket.hibernate.HibernateObjectModel.java

License:Apache License

public HibernateObjectModel(T object) {
    super(object);
    Session session = getCurrentSession();
    this.className = determineClassName(object);
    try {/*from   w w  w  .  j  a  v a2 s. com*/
        this.id = (ID) session.getIdentifier(object);
    } catch (TransientObjectException e) {
        this.unsavedObject = object;
    }
    checkInvariant();
}