2008-05-20

hibernate persist() vs save()

关键字: java
persist() is well defined. It makes a transient instance persistent. However, it doesn't guarantee that the identifier value will be assigned to the persistent instance immediately, the assignment might happen at flush time. The spec doesn't say that, which is the problem I have with persist(). per ...
  模型如下: @Entity public class User extends BaseEntry{ private String name; private int age; @OneToMany(mappedBy = "user", cascade=CascadeType.ALL) private Set<Article> articles = new HashSet<Article>(); ....... }   @Entity public class Article extends B ...
studyworks
搜索本博客
最近访客
存档
最新评论