Example usage for javax.persistence EntityManagerFactory hashCode

List of usage examples for javax.persistence EntityManagerFactory hashCode

Introduction

In this page you can find the example usage for javax.persistence EntityManagerFactory hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:com.github.fharms.camel.route.CamelEntityManagerBean.java

public Integer compareHashCode(Exchange exchange) {
    CamelContext context = exchange.getContext();
    EntityManagerFactory currentEm = em.getEntityManagerFactory();
    if (currentEm.hashCode() != context.getComponent("jpa", JpaComponent.class).getEntityManagerFactory()
            .hashCode()) {/*from w ww  .  j a  va  2s. com*/
        throw new RuntimeException("This is not good!");
    }
    return currentEm.hashCode();
}