List of usage examples for javax.persistence EntityManager hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:com.github.fharms.camel.route.CamelEntityManagerNestedBean.java
public Dog persistDog(EntityManager parentEm) { if (parentEm.hashCode() != em.hashCode()) { throw new RuntimeException("This is not good, hashCode is different!"); }// w ww . j a va 2 s.c om Dog dog = new Dog(); dog.setPetName("Joe"); dog.setBreed("German Shepherd"); em.persist(dog); return dog; }