Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client, portfolio, and security entities created #48

Open
wants to merge 2 commits into
base: flow
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/main/java/com/wellsfargo/counselor/entity/Advisor.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package com.wellsfargo.counselor.entity;


import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.*;


@Entity
public class Advisor {
Expand All @@ -28,7 +26,7 @@ public class Advisor {
@Column(nullable = false)
private String email;

protected Advisor() {
public Advisor(){

}

Expand All @@ -38,6 +36,7 @@ public Advisor(String firstName, String lastName, String address, String phone,
this.address = address;
this.phone = phone;
this.email = email;

}

public Long getAdvisorId() {
Expand Down Expand Up @@ -83,4 +82,5 @@ public String getEmail() {
public void setEmail(String email) {
this.email = email;
}

}
72 changes: 72 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Client.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.wellsfargo.counselor.entity;

import jakarta.persistence.*;

@Entity
public class Client {
@Id
@GeneratedValue()
private long clientId;

@ManyToOne
@JoinColumn(name="advisor_id")
private Advisor advisors;


@Column(nullable = false)
private String firstName;

@Column(nullable = false)
private String lastName;

@Column(nullable = false)
private String address;

public Client(){

}

public Client(Advisor advisors, String firstName, String lastName, String address) {
this.advisors = advisors;
this.firstName = firstName;
this.lastName = lastName;
this.address = address;

}

public long getClientId() {
return clientId;
}

public Advisor getAdvisors() {
return advisors;
}

public void setAdvisors(Advisor advisors) {
this.advisors = advisors;
}

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;
}
}
47 changes: 47 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Portfolio.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.wellsfargo.counselor.entity;

import jakarta.persistence.*;


@Entity
public class Portfolio {

@Id
@GeneratedValue()
private long portfolioId;

@ManyToOne
private Client client;

@Column(nullable = false)
private String creationDate;

public Portfolio(){

}

public Portfolio(String creationDate, Client client) {
this.creationDate = creationDate;
this.client = client;
}

public long getPortfolioId() {
return portfolioId;
}

public String getCreationDate() {
return creationDate;
}

public void setCreationDate(String creationDate) {
this.creationDate = creationDate;
}

public Client getClient() {
return client;
}

public void setClient(Client client) {
this.client = client;
}
}
96 changes: 96 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Security.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package com.wellsfargo.counselor.entity;

import jakarta.persistence.*;


@Entity
public class Security {

@Id
@GeneratedValue()
private long securityId;

@ManyToOne
private Portfolio portfolios;

@Column(nullable = false)
private String name;

@Column(nullable = false)
private String category;

@Column(nullable = false)
private String purchasePrice;

@Column(nullable = false)
private String purchaseData;

@Column(nullable = false)
private String quantity;

public Security(){

}

public Security(Portfolio portfolios, String name, String category, String purchasePrice, String purchaseData, String quantity) {
this.portfolios = portfolios;
this.name = name;
this.category = category;
this.purchasePrice = purchasePrice;
this.purchaseData = purchaseData;
this.quantity = quantity;
}

public long getSecurityId() {
return securityId;
}

public Portfolio getPortfolios() {
return portfolios;
}

public void setPortfolios(Portfolio portfolios) {
this.portfolios = portfolios;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}

public String getPurchasePrice() {
return purchasePrice;
}

public void setPurchasePrice(String purchasePrice) {
this.purchasePrice = purchasePrice;
}

public String getPurchaseData() {
return purchaseData;
}

public void setPurchaseData(String purchaseData) {
this.purchaseData = purchaseData;
}

public String getQuantity() {
return quantity;
}

public void setQuantity(String quantity) {
this.quantity = quantity;
}
}