openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Collins <>
Subject RE: openJPA with EJB3 MySQL on WAS7
Date Fri, 04 Dec 2009 17:29:23 GMT
Just a quick question.  Is the table already created or are you trying to use OpenJPA to create
the table?

-----Original Message-----
From: kpsuk [] 
Sent: Friday, December 04, 2009 9:32 AM
Subject: openJPA with EJB3 MySQL on WAS7

Having a little trouble with openJPA persiting with MySQL, whilst new rows
are being created for each em.persist(dao) the rows are bring populated with
'NULL' values for each column!

I get no error in my logs and debugging shows that the property values are
there right upto the em.persist(dao) line of code.

@Table(name = "tbl_user_details")
public class UserRegistrationDao implements {
	private int id;
	private String firstname;
	private String surname;
	private String email;
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public int getId() {
	public void setId(int id) { = id;
	public synchronized final String getFirstname() {
		return this.firstname;
	public synchronized final void setFirstname(String firstname) {
		this.firstname = firstname;
	public synchronized final String getSurname() {
		return this.surname;
	public synchronized final void setSurname(String surname) {
		this.surname = surname;
	public synchronized final String getEmail() {
	public synchronized final void setEmail(String email) { = email;

	@PersistenceContext(unitName = "users", type =
	private EntityManager _em;
	public boolean create(Map<String, Object> args) {
	UserRegistrationDao dao = new UserRegistrationDao(args);
	_em.persist(dao);  // *** upto here values are present ***


	<persistence-unit name="users" transaction-type="JTA">
		<!-- Enumerate your persistent classes here. -->
			<property name="openjpa.ConnectionURL"
			<property name="openjpa.ConnectionDriverName"
			<property name="openjpa.ConnectionUserName" value="root"/>
			<property name="openjpa.ConnectionPassword" value="rootpass123"/>

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message