/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hibernate;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Ani
 *
*/
@Entity
@Table(name="passwordstore")
public class Passwordstore implements Serializable {
    @Column(name="username", length=50, nullable=false)
    @Id
    private String username;
    @Column(name="password", length=50, nullable=false)
    private String password;
    @OneToOne
    @JoinColumn(name="username")
    private Userdata userdata;

    public Passwordstore() {
    }



    public Passwordstore(Userdata user, String password) {
        this.userdata = user;
        this.username = user.getUsername();
        this.password = password;
    }
    

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Userdata getUserdata() {
        return userdata;
    }

    public void setUserdata(Userdata userdata) {
        this.userdata = userdata;
    }






}
