Skip to content
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
74 changes: 74 additions & 0 deletions .jhipster/NewStockWallet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "user",
"otherEntityName": "user",
"relationshipType": "many-to-one",
"otherEntityField": "login"
},
{
"relationshipId": 2,
"relationshipName": "portfolioStore",
"otherEntityName": "portfolioStore",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "newStockWallet"
}
],
"fields": [
{
"fieldId": 1,
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": [
"required"
]
},
{
"fieldId": 2,
"fieldName": "historicalDataDate",
"fieldType": "LocalDate",
"fieldValidateRules": [
"required"
]
},
{
"fieldId": 3,
"fieldName": "calculatingsDate",
"fieldType": "LocalDate",
"fieldValidateRules": [
"required"
]
},
{
"fieldId": 4,
"fieldName": "prognoseDate",
"fieldType": "LocalDate"
},
{
"fieldId": 5,
"fieldName": "riskfreeRate",
"fieldType": "Double"
},
{
"fieldId": 6,
"fieldName": "expectedReturn",
"fieldType": "Double"
},
{
"fieldId": 7,
"fieldName": "expectedVariation",
"fieldType": "Double"
},
{
"fieldId": 8,
"fieldName": "sharpRatio",
"fieldType": "Double"
}

],
"changelogDate": "20151209201934",
"dto": "no",
"service": "no",
"pagination": "no"
}
29 changes: 29 additions & 0 deletions .jhipster/PortfolioStore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "newStockWallet",
"otherEntityName": "newStockWallet",
"relationshipType": "many-to-one",
"otherEntityField": "name"
},
{
"relationshipId": 2,
"relationshipName": "stockInfo",
"otherEntityName": "stockInfo",
"relationshipType": "many-to-one",
"otherEntityField": "name"
}
],
"fields": [
{
"fieldId": 1,
"fieldName": "percent",
"fieldType": "Double"
}
],
"changelogDate": "20151209201934",
"dto": "no",
"service": "no",
"pagination": "no"
}
53 changes: 53 additions & 0 deletions .jhipster/StockInfo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "stockQuotes",
"otherEntityName": "stockQuotes",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "stockInfo"
},
{
"relationshipId": 2,
"relationshipName": "portfolioStore",
"otherEntityName": "portfolioStore",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "stockInfo"
}
],
"fields": [
{
"fieldId": 1,
"fieldName": "name",
"fieldType": "String",
"fieldValidateRules": []
},
{
"fieldId": 2,
"fieldName": "symbol",
"fieldType": "String",
"fieldValidateRules": []
},
{
"fieldId": 3,
"fieldName": "quotesStartDate",
"fieldType": "LocalDate",
"fieldValidateRules": []
},
{
"fieldId": 4,
"fieldName": "quotesEndDate",
"fieldType": "LocalDate",
"fieldValidateRules": []
},
{
"fieldId": 5,
"fieldName": "isInvestorModeAvaiable",
"fieldType": "Boolean"
}
],
"changelogDate": "20151209210649",
"dto": "no",
"service": "no",
"pagination": "no"
}
39 changes: 39 additions & 0 deletions .jhipster/StockQuotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "stockInfo",
"otherEntityName": "stockInfo",
"relationshipType": "many-to-one",
"otherEntityField": "id"
}
],
"fields": [
{
"fieldId": 1,
"fieldName": "date",
"fieldType": "LocalDate",
"fieldValidateRules": []
},
{
"fieldId": 2,
"fieldName": "value",
"fieldType": "Double",
"fieldValidateRules": []
},
{
"fieldId": 3,
"fieldName": "splitRate",
"fieldType": "Double"
},
{
"fieldId": 4,
"fieldName": "dividend",
"fieldType": "Double"
}
],
"changelogDate": "20151209205511",
"dto": "no",
"service": "no",
"pagination": "no"
}
187 changes: 187 additions & 0 deletions src/main/java/com/pri/cabzza/domain/NewStockWallet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
package com.pri.cabzza.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import java.time.LocalDate;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;

/**
* A NewStockWallet.
*/
@Entity
@Table(name = "new_stock_wallet")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "newstockwallet")
public class NewStockWallet implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@NotNull
@Column(name = "name", nullable = false)
private String name;

@NotNull
@Column(name = "historical_data_date", nullable = false)
private LocalDate historicalDataDate;

@NotNull
@Column(name = "calculatings_date", nullable = false)
private LocalDate calculatingsDate;

@Column(name = "prognose_date", nullable = false)
private LocalDate prognoseDate;

@Column(name = "riskfree_rate")
private Double riskfreeRate;

@Column(name = "expected_return")
private Double expectedReturn;

@Column(name = "expected_variation")
private Double expectedVariation;

@Column(name = "sharp_ratio")
private Double sharpRatio;

@ManyToOne
private User user;

@OneToMany(mappedBy = "newStockWallet")
@JsonIgnore
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<PortfolioStore> portfolioStores = new HashSet<>();

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getName() {
return name;
}

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

public LocalDate getHistoricalDataDate() {
return historicalDataDate;
}

public void setHistoricalDataDate(LocalDate historicalDataDate) {
this.historicalDataDate = historicalDataDate;
}

public LocalDate getCalculatingsDate() {
return calculatingsDate;
}

public void setCalculatingsDate(LocalDate calculatingsDate) {
this.calculatingsDate = calculatingsDate;
}

public LocalDate getPrognoseDate() {
return prognoseDate;
}

public void setPrognoseDate(LocalDate prognoseDate) {
this.prognoseDate = prognoseDate;
}

public Double getRiskfreeRate() {
return riskfreeRate;
}

public void setRiskfreeRate(Double riskfreeRate) {
this.riskfreeRate = riskfreeRate;
}

public Double getExpectedReturn() {
return expectedReturn;
}

public void setExpectedReturn(Double expectedReturn) {
this.expectedReturn = expectedReturn;
}

public Double getExpectedVariation() {
return expectedVariation;
}

public void setExpectedVariation(Double expectedVariation) {
this.expectedVariation = expectedVariation;
}

public Double getSharpRatio() {
return sharpRatio;
}

public void setSharpRatio(Double sharpRatio) {
this.sharpRatio = sharpRatio;
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public Set<PortfolioStore> getPortfolioStores() {
return portfolioStores;
}

public void setPortfolioStores(Set<PortfolioStore> portfolioStores) {
this.portfolioStores = portfolioStores;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

NewStockWallet newStockWallet = (NewStockWallet) o;

if ( ! Objects.equals(id, newStockWallet.id)) return false;

return true;
}

@Override
public int hashCode() {
return Objects.hashCode(id);
}

@Override
public String toString() {
return "NewStockWallet{" +
"id=" + id +
", name='" + name + "'" +
", historicalDataDate='" + historicalDataDate + "'" +
", calculatingsDate='" + calculatingsDate + "'" +
", prognoseDate='" + prognoseDate + "'" +
", riskfreeRate='" + riskfreeRate + "'" +
", expectedReturn='" + expectedReturn + "'" +
", expectedVariation='" + expectedVariation + "'" +
", sharpRatio='" + sharpRatio + "'" +
'}';
}
}
Loading