• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Entitymanager.persist rows all NULL

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
But!
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.

KS
reply
    Bookmark Topic Watch Topic
  • New Topic