vorburger commented on a change in pull request #465: Fineract 614: Rates module
URL: https://github.com/apache/fineract/pull/465#discussion_r257859807
 
 

 ##########
 File path: 
fineract-provider/src/main/java/org/apache/fineract/portfolio/rate/domain/Rate.java
 ##########
 @@ -0,0 +1,209 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fineract.portfolio.rate.domain;
+
+import java.util.LinkedHashMap;
+import java.util.Map;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.fineract.infrastructure.core.api.JsonCommand;
+import org.apache.fineract.useradministration.domain.AppUser;
+
+import javax.persistence.*;
+import java.math.BigDecimal;
+import org.apache.fineract.infrastructure.core.domain.AbstractAuditableCustom;
+
+/**
+ * Bowpi GT Created by Jose on 19/07/2017.
+ */
+
+@Entity
+@Table(name = "m_rate", uniqueConstraints = {
+    @UniqueConstraint(columnNames = {"name"}, name = "name")})
+public class Rate extends AbstractAuditableCustom<AppUser, Long> {
+
+  @Column(name = "name", length = 250, unique = true)
+  private String name;
+
+  @Column(name = "percentage", scale = 10, precision = 2, nullable = false)
+  private BigDecimal percentage;
+
+  @Column(name = "product_apply", length = 100)
+  private String productApply;
+
+  @Column(name = "active", nullable = false)
+  private boolean active;
+
+  @ManyToOne
+  @JoinColumn(name = "approve_user", nullable = true)
+  private AppUser approveUser;
+
+
+  public Rate() {
+  }
+
+
+  public Rate(String name, BigDecimal percentage, String productApply, boolean 
active,
+      AppUser approveUser) {
+    this.name = name;
+    this.percentage = percentage;
+    this.productApply = productApply;
+    this.active = active;
+    this.approveUser = approveUser;
+  }
+
+  public Rate(String name, BigDecimal percentage, String productApply, boolean 
active) {
+    this.name = name;
+    this.percentage = percentage;
+    this.productApply = productApply;
+    this.active = active;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public BigDecimal getPercentage() {
+    return percentage;
+  }
+
+  public void setPercentage(BigDecimal percentage) {
+    this.percentage = percentage;
+  }
+
+  public boolean isActive() {
+    return active;
+  }
+
+  public void setActive(boolean active) {
+    this.active = active;
+  }
+
+  public AppUser getApproveUser() {
+    return approveUser;
+  }
+
+  public void setApproveUser(AppUser approveUser) {
+    this.approveUser = approveUser;
+  }
+
+  public String getProductApply() {
+    return productApply;
+  }
+
+  public void setProductApply(String productApply) {
+    this.productApply = productApply;
+  }
+
+  @Override
+  public int hashCode() {
 
 Review comment:
   it is almost always a bug to only override `hashCode` and not `equals` ... 
Google it for more background. May I suggest that you either remove this 
`hashCode` method or also implement `equals`? I would prefer this not getting 
merged before that is addressed. Sorry I did not notice this before. PS: 
https://issues.apache.org/jira/browse/FINERACT-702 - would you have any 
interest in helping to contribute to that?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to