[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - ejbCreate saving null values

Melladh do-not-reply at jboss.com
Wed Nov 15 08:56:09 EST 2006


I have a bean named ApplicationBean. When I call create on Application, it only creates null values in the database. It does however try to create a new row with these null values.
However, when I call the set methods, it sets properly, and it gets when calling the get properties.

This is my ejbCreate:

	public PersonPK ejbCreate(String name, String surname, String ssn, String email, String status, String registrationDate, int id) throws CreateException
  | 	{
  | 		this.name = name;
  | 		this.surname = surname;
  | 		this.ssn = ssn;
  | 		this.email = email;
  | 		this.status = status;
  | 		this.registrationDate = registrationDate;
  | 		this.id = id;
  | 		
  | 		return null;
  | 	}

It doesn't matter if I return a
 new PersonPK(id)
instead of null, I still get the same results.

Since the getters and setters work, I believe the xml-files are properly set, or they should fail too.
Or so I assume.

Wouldn't be such a big deal, if not for the fact that the primary key can only be set in the create method. Anyone know how to solve this?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986139#3986139

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986139



More information about the jboss-user mailing list