remove eclipse warnings.
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ public class LoanProductBorrowerCycleVariationData {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
this.borrowerCycleNumber = borrowerCycleNumber;
|
this.borrowerCycleNumber = borrowerCycleNumber;
|
||||||
this.paramType = paramType;
|
this.paramType = paramType;
|
||||||
this.valueConditionType = valueConditionType;;
|
this.valueConditionType = valueConditionType;
|
||||||
this.minValue = minValue;
|
this.minValue = minValue;
|
||||||
this.maxValue = maxValue;
|
this.maxValue = maxValue;
|
||||||
this.defaultValue = defaultValue;
|
this.defaultValue = defaultValue;
|
||||||
|
|||||||
+8
-14
@@ -19,7 +19,6 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
|
|||||||
@Table(name = "m_product_loan_variations_borrower_cycle")
|
@Table(name = "m_product_loan_variations_borrower_cycle")
|
||||||
public class LoanProductBorrowerCycleVariations extends AbstractPersistable<Long> {
|
public class LoanProductBorrowerCycleVariations extends AbstractPersistable<Long> {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "loan_product_id", nullable = false)
|
@JoinColumn(name = "loan_product_id", nullable = false)
|
||||||
private LoanProduct loanProduct;
|
private LoanProduct loanProduct;
|
||||||
@@ -69,30 +68,29 @@ public class LoanProductBorrowerCycleVariations extends AbstractPersistable<Long
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
LoanProductBorrowerCycleVariations borrowerCycleVariations = (LoanProductBorrowerCycleVariations) obj;
|
final LoanProductBorrowerCycleVariations borrowerCycleVariations = (LoanProductBorrowerCycleVariations) obj;
|
||||||
boolean minValequal = false;
|
boolean minValequal = false;
|
||||||
if(borrowerCycleVariations.minValue == null && this.minValue == null){
|
if (borrowerCycleVariations.minValue == null && this.minValue == null) {
|
||||||
minValequal = true;
|
minValequal = true;
|
||||||
}else if(borrowerCycleVariations.minValue != null && this.minValue != null){
|
} else if (borrowerCycleVariations.minValue != null && this.minValue != null) {
|
||||||
minValequal = borrowerCycleVariations.minValue.equals(this.minValue);
|
minValequal = borrowerCycleVariations.minValue.equals(this.minValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean maxValequal = false;
|
boolean maxValequal = false;
|
||||||
if(borrowerCycleVariations.maxValue == null && this.maxValue == null){
|
if (borrowerCycleVariations.maxValue == null && this.maxValue == null) {
|
||||||
maxValequal = true;
|
maxValequal = true;
|
||||||
}else if(borrowerCycleVariations.maxValue != null && this.maxValue != null){
|
} else if (borrowerCycleVariations.maxValue != null && this.maxValue != null) {
|
||||||
maxValequal = borrowerCycleVariations.maxValue.equals(this.maxValue);
|
maxValequal = borrowerCycleVariations.maxValue.equals(this.maxValue);
|
||||||
}
|
}
|
||||||
if (borrowerCycleVariations.borrowerCycleNumber.equals(this.borrowerCycleNumber)
|
if (borrowerCycleVariations.borrowerCycleNumber.equals(this.borrowerCycleNumber)
|
||||||
&& borrowerCycleVariations.defaultValue.equals(this.defaultValue)
|
&& borrowerCycleVariations.defaultValue.equals(this.defaultValue) && minValequal && maxValequal
|
||||||
&& minValequal && maxValequal
|
|
||||||
&& borrowerCycleVariations.valueConditionType.equals(this.valueConditionType)
|
&& borrowerCycleVariations.valueConditionType.equals(this.valueConditionType)
|
||||||
&& borrowerCycleVariations.paramType.equals(this.paramType)) { return true; }
|
&& borrowerCycleVariations.paramType.equals(this.paramType)) { return true; }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void copy(LoanProductBorrowerCycleVariations borrowerCycleVariations){
|
public void copy(final LoanProductBorrowerCycleVariations borrowerCycleVariations) {
|
||||||
this.defaultValue = borrowerCycleVariations.defaultValue;
|
this.defaultValue = borrowerCycleVariations.defaultValue;
|
||||||
this.minValue = borrowerCycleVariations.minValue;
|
this.minValue = borrowerCycleVariations.minValue;
|
||||||
this.maxValue = borrowerCycleVariations.maxValue;
|
this.maxValue = borrowerCycleVariations.maxValue;
|
||||||
@@ -100,22 +98,18 @@ public class LoanProductBorrowerCycleVariations extends AbstractPersistable<Long
|
|||||||
this.borrowerCycleNumber = borrowerCycleVariations.borrowerCycleNumber;
|
this.borrowerCycleNumber = borrowerCycleVariations.borrowerCycleNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Integer getBorrowerCycleNumber() {
|
public Integer getBorrowerCycleNumber() {
|
||||||
return this.borrowerCycleNumber;
|
return this.borrowerCycleNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getMinValue() {
|
public BigDecimal getMinValue() {
|
||||||
return this.minValue;
|
return this.minValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getMaxValue() {
|
public BigDecimal getMaxValue() {
|
||||||
return this.maxValue;
|
return this.maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public BigDecimal getDefaultValue() {
|
public BigDecimal getDefaultValue() {
|
||||||
return this.defaultValue;
|
return this.defaultValue;
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-23
@@ -51,8 +51,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final Collection<ChargeData> charges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanProductId);
|
final Collection<ChargeData> charges = this.chargeReadPlatformService.retrieveLoanProductCharges(loanProductId);
|
||||||
final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas = this.retrieveLoanProductBorrowerCycleVariations(loanProductId);
|
final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas = retrieveLoanProductBorrowerCycleVariations(loanProductId);
|
||||||
final LoanProductMapper rm = new LoanProductMapper(charges,borrowerCycleVariationDatas);
|
final LoanProductMapper rm = new LoanProductMapper(charges, borrowerCycleVariationDatas);
|
||||||
final String sql = "select " + rm.loanProductSchema() + " where lp.id = ?";
|
final String sql = "select " + rm.loanProductSchema() + " where lp.id = ?";
|
||||||
|
|
||||||
return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanProductId });
|
return this.jdbcTemplate.queryForObject(sql, rm, new Object[] { loanProductId });
|
||||||
@@ -64,8 +64,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<LoanProductBorrowerCycleVariationData> retrieveLoanProductBorrowerCycleVariations(final Long loanProductId) {
|
public Collection<LoanProductBorrowerCycleVariationData> retrieveLoanProductBorrowerCycleVariations(final Long loanProductId) {
|
||||||
LoanProductBorrowerCycleMapper rm = new LoanProductBorrowerCycleMapper();
|
final LoanProductBorrowerCycleMapper rm = new LoanProductBorrowerCycleMapper();
|
||||||
String sql = "select " + rm.schema() +" where bc.loan_product_id=? order by bc.borrower_cycle_number,bc.value_condition";
|
final String sql = "select " + rm.schema() + " where bc.loan_product_id=? order by bc.borrower_cycle_number,bc.value_condition";
|
||||||
return this.jdbcTemplate.query(sql, rm, new Object[] { loanProductId });
|
return this.jdbcTemplate.query(sql, rm, new Object[] { loanProductId });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
this.context.authenticatedUser();
|
this.context.authenticatedUser();
|
||||||
|
|
||||||
final LoanProductMapper rm = new LoanProductMapper(null,null);
|
final LoanProductMapper rm = new LoanProductMapper(null, null);
|
||||||
|
|
||||||
final String sql = "select " + rm.loanProductSchema();
|
final String sql = "select " + rm.loanProductSchema();
|
||||||
|
|
||||||
@@ -104,7 +104,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
|
|
||||||
private final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas;
|
private final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas;
|
||||||
|
|
||||||
public LoanProductMapper(final Collection<ChargeData> charges,final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas) {
|
public LoanProductMapper(final Collection<ChargeData> charges,
|
||||||
|
final Collection<LoanProductBorrowerCycleVariationData> borrowerCycleVariationDatas) {
|
||||||
this.charges = charges;
|
this.charges = charges;
|
||||||
this.borrowerCycleVariationDatas = borrowerCycleVariationDatas;
|
this.borrowerCycleVariationDatas = borrowerCycleVariationDatas;
|
||||||
}
|
}
|
||||||
@@ -196,17 +197,17 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
status = "loanProduct.active";
|
status = "loanProduct.active";
|
||||||
}
|
}
|
||||||
final String externalId = rs.getString("externalId");
|
final String externalId = rs.getString("externalId");
|
||||||
Collection<LoanProductBorrowerCycleVariationData> principalVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();;
|
final Collection<LoanProductBorrowerCycleVariationData> principalVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();
|
||||||
Collection<LoanProductBorrowerCycleVariationData> interestRateVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();;
|
final Collection<LoanProductBorrowerCycleVariationData> interestRateVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();
|
||||||
Collection<LoanProductBorrowerCycleVariationData> numberOfRepaymentVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();;
|
final Collection<LoanProductBorrowerCycleVariationData> numberOfRepaymentVariationsForBorrowerCycle = new ArrayList<LoanProductBorrowerCycleVariationData>();
|
||||||
if(this.borrowerCycleVariationDatas!=null){
|
if (this.borrowerCycleVariationDatas != null) {
|
||||||
for(LoanProductBorrowerCycleVariationData borrowerCycleVariationData:this.borrowerCycleVariationDatas){
|
for (final LoanProductBorrowerCycleVariationData borrowerCycleVariationData : this.borrowerCycleVariationDatas) {
|
||||||
LoanProductParamType loanProductParamType =borrowerCycleVariationData.getParamType();
|
final LoanProductParamType loanProductParamType = borrowerCycleVariationData.getParamType();
|
||||||
if(loanProductParamType.isParamTypePrincipal()){
|
if (loanProductParamType.isParamTypePrincipal()) {
|
||||||
principalVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
principalVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
||||||
}else if(loanProductParamType.isParamTypeInterestTate()){
|
} else if (loanProductParamType.isParamTypeInterestTate()) {
|
||||||
interestRateVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
interestRateVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
||||||
}else if(loanProductParamType.isParamTypeRepayment()){
|
} else if (loanProductParamType.isParamTypeRepayment()) {
|
||||||
numberOfRepaymentVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
numberOfRepaymentVariationsForBorrowerCycle.add(borrowerCycleVariationData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -217,8 +218,9 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
minInterestRatePerPeriod, maxInterestRatePerPeriod, annualInterestRate, repaymentFrequencyType,
|
minInterestRatePerPeriod, maxInterestRatePerPeriod, annualInterestRate, repaymentFrequencyType,
|
||||||
interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, fundId, fundName,
|
interestRateFrequencyType, amortizationType, interestType, interestCalculationPeriodType, fundId, fundName,
|
||||||
transactionStrategyId, transactionStrategyName, graceOnPrincipalPayment, graceOnInterestPayment,
|
transactionStrategyId, transactionStrategyName, graceOnPrincipalPayment, graceOnInterestPayment,
|
||||||
graceOnInterestCharged, this.charges, accountingRuleType, includeInBorrowerCycle, useBorrowerCycle, startDate, closeDate,
|
graceOnInterestCharged, this.charges, accountingRuleType, includeInBorrowerCycle, useBorrowerCycle, startDate,
|
||||||
status, externalId, principalVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle, numberOfRepaymentVariationsForBorrowerCycle);
|
closeDate, status, externalId, principalVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle,
|
||||||
|
numberOfRepaymentVariationsForBorrowerCycle);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -253,14 +255,16 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final class LoanProductBorrowerCycleMapper implements RowMapper<LoanProductBorrowerCycleVariationData> {
|
private static final class LoanProductBorrowerCycleMapper implements RowMapper<LoanProductBorrowerCycleVariationData> {
|
||||||
public String schema(){
|
|
||||||
return "bc.id as id,bc.borrower_cycle_number as cycleNumber,bc.value_condition as conditionType,bc.param_type as paramType," +
|
public String schema() {
|
||||||
"bc.default_value as defaultValue,bc.max_value as maxVal,bc.min_value as minVal "+
|
return "bc.id as id,bc.borrower_cycle_number as cycleNumber,bc.value_condition as conditionType,bc.param_type as paramType,"
|
||||||
"from m_product_loan_variations_borrower_cycle bc";
|
+ "bc.default_value as defaultValue,bc.max_value as maxVal,bc.min_value as minVal "
|
||||||
|
+ "from m_product_loan_variations_borrower_cycle bc";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoanProductBorrowerCycleVariationData mapRow(ResultSet rs, @SuppressWarnings("unused") int rowNum) throws SQLException {
|
public LoanProductBorrowerCycleVariationData mapRow(final ResultSet rs, @SuppressWarnings("unused") final int rowNum)
|
||||||
|
throws SQLException {
|
||||||
final Long id = rs.getLong("id");
|
final Long id = rs.getLong("id");
|
||||||
final Integer cycleNumber = JdbcSupport.getInteger(rs, "cycleNumber");
|
final Integer cycleNumber = JdbcSupport.getInteger(rs, "cycleNumber");
|
||||||
final Integer conditionType = JdbcSupport.getInteger(rs, "conditionType");
|
final Integer conditionType = JdbcSupport.getInteger(rs, "conditionType");
|
||||||
@@ -271,7 +275,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo
|
|||||||
final BigDecimal maxValue = rs.getBigDecimal("maxVal");
|
final BigDecimal maxValue = rs.getBigDecimal("maxVal");
|
||||||
final BigDecimal minValue = rs.getBigDecimal("minVal");
|
final BigDecimal minValue = rs.getBigDecimal("minVal");
|
||||||
|
|
||||||
LoanProductBorrowerCycleVariationData borrowerCycleVariationData = new LoanProductBorrowerCycleVariationData(id,cycleNumber, paramTypeData, conditionTypeData, defaultValue, minValue, maxValue);
|
final LoanProductBorrowerCycleVariationData borrowerCycleVariationData = new LoanProductBorrowerCycleVariationData(id,
|
||||||
|
cycleNumber, paramTypeData, conditionTypeData, defaultValue, minValue, maxValue);
|
||||||
return borrowerCycleVariationData;
|
return borrowerCycleVariationData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user