From 9c2f9ce17d412bc367e25046978f318126a118da Mon Sep 17 00:00:00 2001 From: Karz1459 Date: Thu, 15 Jun 2023 17:54:19 +0530 Subject: [PATCH 1/2] new classes --- .../java/com/wellsfargo/counselor/Client.java | 52 +++++++++++ .../com/wellsfargo/counselor/Portfolio.java | 54 +++++++++++ .../com/wellsfargo/counselor/Security.java | 89 +++++++++++++++++++ .../wellsfargo/counselor/entity/Advisor.java | 86 ------------------ .../counselor/entity/Financialadvisor.java | 40 +++++++++ 5 files changed, 235 insertions(+), 86 deletions(-) create mode 100644 src/main/java/com/wellsfargo/counselor/Client.java create mode 100644 src/main/java/com/wellsfargo/counselor/Portfolio.java create mode 100644 src/main/java/com/wellsfargo/counselor/Security.java delete mode 100644 src/main/java/com/wellsfargo/counselor/entity/Advisor.java create mode 100644 src/main/java/com/wellsfargo/counselor/entity/Financialadvisor.java diff --git a/src/main/java/com/wellsfargo/counselor/Client.java b/src/main/java/com/wellsfargo/counselor/Client.java new file mode 100644 index 00000000..30b5e43d --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/Client.java @@ -0,0 +1,52 @@ +package com.wellsfargo.counselor; + +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +public class Client { + + @Id + @GeneratedValue() + private long Clientid; + + @Column(nullable = false) + private String Clientname; + + @Column(nullable = false) + private String Advisorid; + + protected Client() { + + } + + public Client(long Clientid, String Clientname, String Advisorid) { + this.Clientid = Clientid; + this.Clientname = Clientname; + this.Advisorid = Advisorid; + } + public long getClientid() { + return Clientid; + } + + public void setClientid(String Clientid) { + this.Clientid = Long.parseLong(Clientid); + } + + public String Clientname() { + return Clientname; + } + + public void setClientname(String Clientname) { + this.Clientname = Clientname; + } + + public String getAdvisorid() { + return Advisorid; + } + + public void setAdvisorid(String Advisorid) { + this.Advisorid = Advisorid; + } + +} \ No newline at end of file diff --git a/src/main/java/com/wellsfargo/counselor/Portfolio.java b/src/main/java/com/wellsfargo/counselor/Portfolio.java new file mode 100644 index 00000000..67df8ec5 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/Portfolio.java @@ -0,0 +1,54 @@ +package com.wellsfargo.counselor; + +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +public class Portfolio { + + @Id + @GeneratedValue() + + @Column(nullable = false) + private long Portfolioid; + + @Column(nullable = false) + private String Product_name; + + @Column(nullable = false) + private long Clientid; + + protected Portfolio() { + + } + + public Portfolio(long Portfolioid, String Product_name, long Clientid) { + this.Portfolioid = Portfolioid; + this.Product_name = Product_name; + this.Clientid = Clientid; + } + public long getPortfolioid() { + return Portfolioid; + } + + public void setPortfolioid(String Portfolioid) { + this.Portfolioid = Long.parseLong(Portfolioid); + } + + public String Product_name() { + return Product_name; + } + + public void setProduct_name(String product_name) { + this.Product_name = Product_name; + } + + public long getClientid() { + return Clientid; + } + + public void setClientid(String Clientid) { + this.Clientid = Long.parseLong(Clientid); + } + +} diff --git a/src/main/java/com/wellsfargo/counselor/Security.java b/src/main/java/com/wellsfargo/counselor/Security.java new file mode 100644 index 00000000..4c21861e --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/Security.java @@ -0,0 +1,89 @@ +package com.wellsfargo.counselor; + +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; + +import java.util.Date; + +public class Security { + + @jakarta.persistence.Id + @GeneratedValue() + @Column(nullable = false) + private long Id; + + @Column(nullable = false) + private String Category; + + @Column(nullable = false) + private String Purchase_date; + + @Column(nullable = false) + private long Purchase_price; + + @Column(nullable = false) + private long Quantity; + + @Column(nullable = false) + private long Portfolio_id; + protected Security() { + + } + + public Security(long Id, String Category, Date Purchase_date, long Purchase_price, long Quantity, long Portfolio_id) { + this.Id = Id; + this.Category = Category; + this.Purchase_date = String.valueOf(Purchase_date); + this.Purchase_price = Purchase_price; + this.Quantity = Quantity; + this.Portfolio_id = Portfolio_id; + } + public long getId() { + return Id; + } + + public void setId(String Id) { + this.Id = Long.parseLong(Id); + } + + public String Category() { + return Category; + } + + public void setCategory(String Category) { + this.Category = Category; + } + + public String getPurchase_date() { + return Purchase_date; + } + + public void setPurchase_date(String Purchase_date) { + this.Purchase_date = Purchase_date; + } + + public long getPurchase_price() { + return Purchase_price; + } + + public void setPurchase_price(String Purchase_price) { + this.Purchase_price = Long.parseLong(Purchase_price); + } + + public long getQuantity() { + return Quantity; + } + + public void setQuantity(String Quantity) { + this.Quantity = Long.parseLong(Quantity); + } + + public long getPortfolio_id() { + return Portfolio_id; + } + + public void setPortfolio_id(String Portfolio_id) { + this.Portfolio_id = Long.parseLong(Portfolio_id); + } + +} diff --git a/src/main/java/com/wellsfargo/counselor/entity/Advisor.java b/src/main/java/com/wellsfargo/counselor/entity/Advisor.java deleted file mode 100644 index 1a6861ec..00000000 --- a/src/main/java/com/wellsfargo/counselor/entity/Advisor.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.wellsfargo.counselor.entity; - - -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; - -@Entity -public class Advisor { - - @Id - @GeneratedValue() - private long advisorId; - - @Column(nullable = false) - private String firstName; - - @Column(nullable = false) - private String lastName; - - @Column(nullable = false) - private String address; - - @Column(nullable = false) - private String phone; - - @Column(nullable = false) - private String email; - - protected Advisor() { - - } - - public Advisor(String firstName, String lastName, String address, String phone, String email) { - this.firstName = firstName; - this.lastName = lastName; - this.address = address; - this.phone = phone; - this.email = email; - } - - public Long getAdvisorId() { - return advisorId; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } -} diff --git a/src/main/java/com/wellsfargo/counselor/entity/Financialadvisor.java b/src/main/java/com/wellsfargo/counselor/entity/Financialadvisor.java new file mode 100644 index 00000000..a57b03b1 --- /dev/null +++ b/src/main/java/com/wellsfargo/counselor/entity/Financialadvisor.java @@ -0,0 +1,40 @@ +package com.wellsfargo.counselor.entity; + + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + +@Entity +public class Financialadvisor { + + @Id + @GeneratedValue() + private long advisor_id; + + @Column(nullable = false) + private String Name; + + protected Financialadvisor() { + + } + + public Financialadvisor(long advisor_id, String Name) { + this.advisor_id = advisor_id; + this.Name = Name; + } + + public Long getAdvisor_id() { + return advisor_id; + } + + public String getName() { + return Name; + } + + public void setName(String Name) { + this.Name = Name; + } +} + From 48ac15fe22ebb8ff5abe414cb92107e0fbbea8dc Mon Sep 17 00:00:00 2001 From: Karz1459 Date: Thu, 15 Jun 2023 18:09:00 +0530 Subject: [PATCH 2/2] new classes --- src/main/java/com/wellsfargo/counselor/{ => entity}/Client.java | 2 +- .../java/com/wellsfargo/counselor/{ => entity}/Portfolio.java | 2 +- .../java/com/wellsfargo/counselor/{ => entity}/Security.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/main/java/com/wellsfargo/counselor/{ => entity}/Client.java (96%) rename src/main/java/com/wellsfargo/counselor/{ => entity}/Portfolio.java (96%) rename src/main/java/com/wellsfargo/counselor/{ => entity}/Security.java (97%) diff --git a/src/main/java/com/wellsfargo/counselor/Client.java b/src/main/java/com/wellsfargo/counselor/entity/Client.java similarity index 96% rename from src/main/java/com/wellsfargo/counselor/Client.java rename to src/main/java/com/wellsfargo/counselor/entity/Client.java index 30b5e43d..2b8e3036 100644 --- a/src/main/java/com/wellsfargo/counselor/Client.java +++ b/src/main/java/com/wellsfargo/counselor/entity/Client.java @@ -1,4 +1,4 @@ -package com.wellsfargo.counselor; +package com.wellsfargo.counselor.entity; import jakarta.persistence.Column; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/com/wellsfargo/counselor/Portfolio.java b/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java similarity index 96% rename from src/main/java/com/wellsfargo/counselor/Portfolio.java rename to src/main/java/com/wellsfargo/counselor/entity/Portfolio.java index 67df8ec5..6b7877bc 100644 --- a/src/main/java/com/wellsfargo/counselor/Portfolio.java +++ b/src/main/java/com/wellsfargo/counselor/entity/Portfolio.java @@ -1,4 +1,4 @@ -package com.wellsfargo.counselor; +package com.wellsfargo.counselor.entity; import jakarta.persistence.Column; import jakarta.persistence.GeneratedValue; diff --git a/src/main/java/com/wellsfargo/counselor/Security.java b/src/main/java/com/wellsfargo/counselor/entity/Security.java similarity index 97% rename from src/main/java/com/wellsfargo/counselor/Security.java rename to src/main/java/com/wellsfargo/counselor/entity/Security.java index 4c21861e..b1a1f466 100644 --- a/src/main/java/com/wellsfargo/counselor/Security.java +++ b/src/main/java/com/wellsfargo/counselor/entity/Security.java @@ -1,4 +1,4 @@ -package com.wellsfargo.counselor; +package com.wellsfargo.counselor.entity; import jakarta.persistence.Column; import jakarta.persistence.GeneratedValue;