/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package plate.wellmann.shop.persistence;

import java.util.Arrays;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;

/**
 *
 * @author Patrick
 */
@Entity
@NamedQueries({
    @NamedQuery(name = "MyPassword.findByPassword",
            query = "SELECT p FROM Password p WHERE p.password = :password"),
    @NamedQuery(name = "Password.findByCostumerID",
            query = "SELECT p FROM Password p WHERE p.customer = :customer")
})
public class Password extends AbstractEntity {
    
    @OneToOne
    private final Customer customer;
    
    @Column(name="password")
    private String password;
    
    public Password (Customer costumer, String password) {
        this.customer = costumer;
        this.password = password;
    }
    
    public Customer getCostumer() {
        return customer;
    }

    public String getPassword() {
        return password;
    }
    
    public void setPassowrd(String password){
        this.password = password;
    }
}
