microservices-event-sourcing-master/account-service/src/main/java/com/timeyang/creditcard/CreditCard.java
package com.timeyang.creditcard;

import com.timeyang.data.BaseEntity;

import javax.persistence.*;

/**
 * @author chaokunyang
 */
@Entity
public class CreditCard extends BaseEntity {

    private Long id;
    private String number;
    @Enumerated(EnumType.STRING)
    private CreditCardType type;

    public CreditCard() {
    }

    public CreditCard(String number, CreditCardType type) {
        this.number = number;
        this.type = type;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public CreditCardType getType() {
        return type;
    }

    public void setType(CreditCardType type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "CreditCard{" +
                "id=" + id +
                ", number='" + number + '\'' +
                ", type=" + type +
                '}';
    }
}
