1 package org.hibernate.ce.auction.model; 2 3 import javax.persistence.*; 4 5 10 @Entity(access = AccessType.FIELD) 11 @Table(name = "BANK_ACCOUNT") 12 @JoinColumn(name = "BANK_ACCOUNT_ID") 13 public class BankAccount extends BillingDetails { 14 15 @Column(name = "BA_NUMBER", nullable = false, updatable = false) 16 private String number; 17 18 @Column(name = "BA_NAME", nullable = false, updatable = false) 19 private String bankName; 20 21 @Column(name = "BANK_SWIFT", nullable = false, updatable = false) 22 private String bankSwift; 23 24 27 BankAccount() { super(); } 28 29 38 public BankAccount(String ownerName, User user, String number, String bankName, String bankSwift) { 39 super(ownerName, user); 40 this.number = number; 41 this.bankName = bankName; 42 this.bankSwift = bankSwift; 43 } 44 45 47 public String getNumber() { return number; } 48 public void setNumber(String number) { this.number = number; } 49 50 public String getBankName() { return bankName; } 51 public void setBankName(String bankName) { this.bankName = bankName; } 52 53 public String getBankSwift() { return bankSwift; } 54 public void setBankSwift(String bankSwift) { this.bankSwift = bankSwift; } 55 56 58 public String toString() { 59 return "BankAccount ('" + getId() + "'), " + 60 "Number: '" + getNumber() + "'"; 61 } 62 63 65 public boolean isValid() { 66 return true; 68 } 69 70 } 71 | Popular Tags |