如何从em.find
方法中获取相同的实体?
Address address=em.find(Address.class,1);
System.out.println("Name of Address: "+address.getAddressName); // Chinnur
address.setAddressName("Russia");
Address address1=em.find(Address.class,address.getAddressId());
System.out.println("Name of Address: "+address1.getAddressName); //?????????
我需要address1.getAddressName
的是“chinnur”,
但我得到 address1.getAddressName
的是“俄罗斯”
我需要简短的解释,请帮助我。