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

Implemented the lombok to reduce boilerplate code in the entity classes #35

Open
wants to merge 1 commit into
base: master
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
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ dependencies {
testImplementation 'junit:junit:4.13'
implementation 'com.amazonaws:aws-java-sdk:1.11.486'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.12.0'
compileOnly 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
}

group = 'hu.dpc.phee'
Expand Down
171 changes: 6 additions & 165 deletions src/main/java/hu/dpc/phee/operator/entity/batch/Batch.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package hu.dpc.phee.operator.entity.batch;

import hu.dpc.phee.operator.entity.parent.AbstractPersistableCustom;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.eclipse.persistence.annotations.Index;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

@Entity
@Table(name = "batches")
@Getter
@Setter
@NoArgsConstructor
public class Batch extends AbstractPersistableCustom<Long> {

@Column(name = "BATCH_ID")
private String batchId;

Expand Down Expand Up @@ -74,170 +78,7 @@ public class Batch extends AbstractPersistableCustom<Long> {
@Column(name = "PAYMENT_MODE")
private String paymentMode;

public Batch() {
}

public Batch(Long workflowInstanceKey) {
this.workflowInstanceKey = workflowInstanceKey;
}

public String getBatchId() {
return batchId;
}

public void setBatchId(String batchId) {
this.batchId = batchId;
}

public String getRequestId() {
return requestId;
}

public void setRequestId(String requestId) {
this.requestId = requestId;
}

public String getRequestFile() {
return requestFile;
}

public void setRequestFile(String requestFile) {
this.requestFile = requestFile;
}

public Long getTotalTransactions() {
return totalTransactions;
}

public void setTotalTransactions(Long totalTransactions) {
this.totalTransactions = totalTransactions;
}

public Long getOngoing() {
return ongoing;
}

public void setOngoing(Long ongoing) {
this.ongoing = ongoing;
}

public Long getFailed() {
return failed;
}

public void setFailed(Long failed) {
this.failed = failed;
}

public Long getCompleted() {
return completed;
}

public void setCompleted(Long completed) {
this.completed = completed;
}

public String getResult_file() {
return result_file;
}

public void setResult_file(String result_file) {
this.result_file = result_file;
}

public Date getResultGeneratedAt() {
return resultGeneratedAt;
}

public void setResultGeneratedAt(Date resultGeneratedAt) {
this.resultGeneratedAt = resultGeneratedAt;
}

public String getNote() {
return note;
}

public void setNote(String note) {
this.note = note;
}

public Long getWorkflowKey() {
return workflowKey;
}

public void setWorkflowKey(Long workflowKey) {
this.workflowKey = workflowKey;
}

public Long getWorkflowInstanceKey() {
return workflowInstanceKey;
}

public void setWorkflowInstanceKey(Long workflowInstanceKey) {
this.workflowInstanceKey = workflowInstanceKey;
}

public Date getStartedAt() {
return startedAt;
}

public void setStartedAt(Date startedAt) {
this.startedAt = startedAt;
}

public Date getCompletedAt() {
return completedAt;
}

public void setCompletedAt(Date completedAt) {
this.completedAt = completedAt;
}

public String getSubBatchId() {
return subBatchId;
}

public void setSubBatchId(String subBatchId) {
this.subBatchId = subBatchId;
}

public Long getTotalAmount() {
return totalAmount;
}

public void setTotalAmount(Long totalAmount) {
this.totalAmount = totalAmount;
}

public Long getOngoingAmount() {
return ongoingAmount;
}

public void setOngoingAmount(Long ongoingAmount) {
this.ongoingAmount = ongoingAmount;
}

public Long getFailedAmount() {
return failedAmount;
}

public void setFailedAmount(Long failedAmount) {
this.failedAmount = failedAmount;
}

public Long getCompletedAmount() {
return completedAmount;
}

public void setCompletedAmount(Long completedAmount) {
this.completedAmount = completedAmount;
}

public String getPaymentMode() {
return paymentMode;
}

public void setPaymentMode(String mode) {
this.paymentMode = mode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;

public interface BatchRepository extends JpaRepository<Batch, Long>, JpaSpecificationExecutor {

Expand Down
142 changes: 6 additions & 136 deletions src/main/java/hu/dpc/phee/operator/entity/batch/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({ "id", "request_id", "payment_mode", "account_number", "payer_identifier_type", "payer_identifier", "payee_identifier_type", "payee_identifier", "amount", "currency", "note", "program_shortcode", "cycle" })
@Getter
@Setter
@ToString
public class Transaction implements CsvSchema {

@JsonProperty("id")
Expand Down Expand Up @@ -54,142 +60,6 @@ public class Transaction implements CsvSchema {
@JsonIgnore
private String status;


public int getId() {
return id;
}

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

public String getRequestId() {
return requestId;
}

public void setRequestId(String requestId) {
this.requestId = requestId;
}

public String getPaymentMode() {
return paymentMode;
}

public void setPaymentMode(String paymentMode) {
this.paymentMode = paymentMode;
}

public String getAccountNumber() {
return accountNumber;
}

public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}

public String getAmount() {
return amount;
}

public void setAmount(String amount) {
this.amount = amount;
}

public String getCurrency() {
return currency;
}

public void setCurrency(String currency) {
this.currency = currency;
}

public String getNote() {
return note;
}

public void setNote(String note) {
this.note = note;
}

public String getBatchId() {
return batchId;
}

public void setBatchId(String batchId) {
this.batchId = batchId;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public String getPayerIdentifierType() {
return payerIdentifierType;
}

public void setPayerIdentifierType(String payerIdentifierType) {
this.payerIdentifierType = payerIdentifierType;
}

public String getPayerIdentifier() {
return payerIdentifier;
}

public void setPayerIdentifier(String payerIdentifier) {
this.payerIdentifier = payerIdentifier;
}

public String getPayeeIdentifierType() {
return payeeIdentifierType;
}

public void setPayeeIdentifierType(String payeeIdentifierType) {
this.payeeIdentifierType = payeeIdentifierType;
}

public String getPayeeIdentifier() {
return payeeIdentifier;
}

public void setPayeeIdentifier(String payeeIdentifier) {
this.payeeIdentifier = payeeIdentifier;
}

public String getProgramShortCode() {
return programShortCode;
}

public void setProgramShortCode(String programShortCode) {
this.programShortCode = programShortCode;
}

public String getCycle() {
return cycle;
}

public void setCycle(String cycle) {
this.cycle = cycle;
}

@Override
public String toString() {
return "Transaction{" +
"id=" + id +
", request_id='" + requestId + '\'' +
", payment_mode='" + paymentMode + '\'' +
", account_number='" + accountNumber + '\'' +
", amount='" + amount + '\'' +
", currency='" + currency + '\'' +
", note='" + note + '\'' +
", batchId='" + batchId + '\'' +
", status='" + status + '\'' +
'}';
}

@JsonIgnore
@Override
public String getCsvString() {
Expand Down
Loading