It's simple: there is an Entity
{
@Id private Integer
private
String name
}
..getters and setters.
table, persistence.xml and mysql-ds.xml file all working well:
entityManager.persist(
test); adds a line to DB,
getById also works (using EJB-QL...).
the problem:
after I do persist for that bean I get null from the getID() method of the
entity.
further test:
I add a @PostPersist method that prints the id value, and guess what? it printed the Id that was given (auto increment) in the table.
so:
the insertion went fine. but why is there null when invoking getId()
after persist?
thank all in advance.
Gal
p.s.: here is the table and the bean:
[ January 13, 2008: Message edited by: Gal Rubinstein ]