Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Why is @Id GenerationType.AUTO null after persist?

Marcel Ruff

2008-08-07

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,

having

class Test
  @Id()
  @Column(name = "id", unique = true)
  @GeneratedValue(strategy = GenerationType.AUTO)
  public Long getId() {
    return this.id;
  }

em.persist(test);
test.getId() -----> IS NULL

Shouldn't it contain the generated id filled by persist?

Thanks
Marcel


--
Marcel Ruff
http://www.xmlBlaster.org
http://watchee.net
Phone: +49 7551 309371

©2008 gg3721.com - Jax Systems, LLC, U.S.A.