package org.academiadecodigo.enuminatti.hibernatebootstrap.inheritance.mappedsuperclass;

import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

@Entity
@Table(name = "account_mapped")
public class Account extends AbstractModel {
    private double balance;

    @OneToOne
    private Customer customer;

    public Account() {
    }

    public Account(double balance) {
        this.balance = balance;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public String toString() {
        return "Account{" +
                "balance=" + balance +
                '}';
    }
}
