// Path: server/accounting/src/main/java/de/budgetfreak/accounting/domain/Account.java
// @Entity(name = "BF_ACCOUNT")
// public class Account {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "DESCRIPTION")
//     private String description;
// 
//     @Column(name = "ON_BUDGET")
//     private boolean onBudget;
// 
//     @ManyToOne(fetch = FetchType.LAZY)
//     @JoinColumn(name = "USER_ID")
//     private User user;
// 
//     public Account() {
//     }
// 
//     public Account(String description, boolean onBudget, User user) {
//         this.description = description;
//         this.onBudget = onBudget;
//         this.user = user;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public Account setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public Account setDescription(String description) {
//         this.description = description;
//         return this;
//     }
// 
//     public boolean isOnBudget() {
//         return onBudget;
//     }
// 
//     public Account setOnBudget(boolean onBudget) {
//         this.onBudget = onBudget;
//         return this;
//     }
// 
//     public User getUser() {
//         return user;
//     }
// 
//     public Account setUser(User user) {
//         this.user = user;
//         return this;
//     }
// }


import de.budgetfreak.accounting.domain.Account;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
package de.budgetfreak.budgeting.domain;



/**
 * A transaction is money spent issued to a {@link Payee}.
 * Transactions are assigned to an {@link Account} and a {@link Category}.
 */
@Entity(name = "BF_TRANSACTION")
public class Transaction {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    private Long id;

    @Column(name = "AMOUNT")
    private BigDecimal amount;

    @Column(name = "BOOKING_DATE")
    private Date bookingDate;

    @Column(name = "DESCRIPTION")
    private String description;

    @Column(name = "CLEARED")
    private boolean cleared;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PAYEE_ID")
    private Payee payee;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CATEGORY_ID")
    private Category category;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ACCOUNT_ID")
// Path: server/accounting/src/main/java/de/budgetfreak/accounting/domain/Account.java
// @Entity(name = "BF_ACCOUNT")
// public class Account {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.IDENTITY)
//     @Column(name = "ID")
//     private Long id;
// 
//     @Column(name = "DESCRIPTION")
//     private String description;
// 
//     @Column(name = "ON_BUDGET")
//     private boolean onBudget;
// 
//     @ManyToOne(fetch = FetchType.LAZY)
//     @JoinColumn(name = "USER_ID")
//     private User user;
// 
//     public Account() {
//     }
// 
//     public Account(String description, boolean onBudget, User user) {
//         this.description = description;
//         this.onBudget = onBudget;
//         this.user = user;
//     }
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public Account setId(Long id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public Account setDescription(String description) {
//         this.description = description;
//         return this;
//     }
// 
//     public boolean isOnBudget() {
//         return onBudget;
//     }
// 
//     public Account setOnBudget(boolean onBudget) {
//         this.onBudget = onBudget;
//         return this;
//     }
// 
//     public User getUser() {
//         return user;
//     }
// 
//     public Account setUser(User user) {
//         this.user = user;
//         return this;
//     }
// }


// Path: server/budgeting/src/main/java/de/budgetfreak/budgeting/domain/Transaction.java
import de.budgetfreak.accounting.domain.Account;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

package de.budgetfreak.budgeting.domain;



/**
 * A transaction is money spent issued to a {@link Payee}.
 * Transactions are assigned to an {@link Account} and a {@link Category}.
 */
@Entity(name = "BF_TRANSACTION")
public class Transaction {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    private Long id;

    @Column(name = "AMOUNT")
    private BigDecimal amount;

    @Column(name = "BOOKING_DATE")
    private Date bookingDate;

    @Column(name = "DESCRIPTION")
    private String description;

    @Column(name = "CLEARED")
    private boolean cleared;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "PAYEE_ID")
    private Payee payee;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "CATEGORY_ID")
    private Category category;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ACCOUNT_ID")
    private Account account;