KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ce > auction > model > BankAccount


1 package org.hibernate.ce.auction.model;
2
3 import javax.persistence.*;
4
5 /**
6  * This billing strategy uses a simple bank account.
7  *
8  * @author Christian Bauer <christian@hibernate.org>
9  */

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 JavaDoc number;
17
18     @Column(name = "BA_NAME", nullable = false, updatable = false)
19     private String JavaDoc bankName;
20
21     @Column(name = "BANK_SWIFT", nullable = false, updatable = false)
22     private String JavaDoc bankSwift;
23
24     /**
25      * No-arg constructor for JavaBean tools.
26      */

27     BankAccount() { super(); }
28
29     /**
30      * Full constructor.
31      *
32      * @param ownerName
33      * @param user
34      * @param number
35      * @param bankName
36      * @param bankSwift
37      */

38     public BankAccount(String JavaDoc ownerName, User user, String JavaDoc number, String JavaDoc bankName, String JavaDoc bankSwift) {
39         super(ownerName, user);
40         this.number = number;
41         this.bankName = bankName;
42         this.bankSwift = bankSwift;
43     }
44
45     // ********************** Accessor Methods ********************** //
46

47     public String JavaDoc getNumber() { return number; }
48     public void setNumber(String JavaDoc number) { this.number = number; }
49
50     public String JavaDoc getBankName() { return bankName; }
51     public void setBankName(String JavaDoc bankName) { this.bankName = bankName; }
52
53     public String JavaDoc getBankSwift() { return bankSwift; }
54     public void setBankSwift(String JavaDoc bankSwift) { this.bankSwift = bankSwift; }
55
56     // ********************** Common Methods ********************** //
57

58     public String JavaDoc toString() {
59         return "BankAccount ('" + getId() + "'), " +
60                 "Number: '" + getNumber() + "'";
61     }
62
63     // ********************** Business Methods ********************** //
64

65     public boolean isValid() {
66         // TODO: Validate bank account syntax.
67
return true;
68     }
69
70 }
71
Popular Tags