• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Entitymanager.persist rows all NULL

Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys

I have an DAO called RegUserDao which is populated by a hashMap of values (firstname, surname, email, username, password).
I then have a Stateless bean called RegUserBean which creates an instance of this DAO and executes EntityManager.persist(dao)

Now debugging this, everything looks fine, at the point of the _em.persist(dao); line, the values of the above properties are correct,
there is no exception and the app forwards to the next screen as expected.
On viewing the DB, I see that all of the values have been set to 'NULL', now I tried a little test to set off teh columns to Allow NULL = No and I got the following error:

(This is the same for each column)

Here is the DAO

And Bean

I can't see anything that would suggest it's the code and I can't see it being the WebApp config or Database because as I say, it creates the rows in the tables, it just populates with NULL values instead of the values stored in the DAO.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic