1

如何从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的是“俄罗斯”

我需要简短的解释,请帮助我。

4

1 回答 1

0

修改后的实体存储在事务中cache,当您想再次检索时显示缓存结果

于 2013-04-19T05:51:26.047 回答