-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: java.sql.SQLException: Field 'passwordConfirmation' doesn't
PostPosted: Thu Jun 30, 2011 10:00 am 
Newbie

Joined: Tue Aug 24, 2010 7:24 am
Posts: 9
I've been scratching my head over this error for sometime now but can't work it out. I've been using Hibernate 3 to persist User entity. But I am getting java.sql.SQLException: Field 'passwordConfirmation' doesn't have a default value error when I try to do that.

Following is my User entity:
User.java
Code:
@Entity
public class User implements Serializable {

    private Long id;
    private String email;
    private String password;
    private String passwordConfirmation;   
    private String captcha;

    @Id @GeneratedValue
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }

    @NotEmpty
    @Email
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }

    @NotEmpty   
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
}


Could someone help me understand that why am I getting this error?


Top
 Profile  
 
 Post subject: Re: java.sql.SQLException: Field 'passwordConfirmation' doesn't
PostPosted: Thu Jun 30, 2011 10:10 pm 
Newbie

Joined: Tue Aug 24, 2010 7:24 am
Posts: 9
I was mistakenly using a different schema than the one I was generating using Hibernate. Both the schema had passwordConfirmation field in the User entity so got confused.

I've got it working now. Thanks :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.