somasorosdpc commented on code in PR #4526:
URL: https://github.com/apache/fineract/pull/4526#discussion_r2028528249


##########
fineract-progressive-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/ProgressiveLoanModel.java:
##########
@@ -0,0 +1,47 @@
+/**
+ * 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.loanaccount.domain;
+
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.JoinColumn;
+import jakarta.persistence.OneToOne;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
+import lombok.Getter;
+import lombok.Setter;
+import 
org.apache.fineract.infrastructure.core.domain.AbstractPersistableCustom;
+
+@Entity
+@Table(name = "m_loan_progressive_model")
+@Getter
+@Setter
+public class ProgressiveLoanModel extends AbstractPersistableCustom<Long> {
+
+    @Version
+    int version;
+
+    @OneToOne
+    @JoinColumn(name = "loan_id")
+    private Loan loan;
+
+    @Column(name = "json_model", columnDefinition = "text")

Review Comment:
   It is a really tough answer. First of all I've tried to achieve it as 
json/jsonb. There is no issue to do it for Maria/MySQL ( I've tested. ) Issue 
comes when DB implementation is Postgres, because it is strict  in data types, 
which caused an Exception on the JPA side. I started to dig deeper to JPA 
implementations and possibilities to manually implement some converter. 
Hibernate has built in solution for that. The only problem is fineract uses 
Eclipselink which has no solution to do it. There is a try to do it with JDBC 
in `CustomJobParameterRepositoryImpl` . As I was checking the effort and the 
workaround, also the use cases, I was decided to go with text field instead of 
a hacky solution.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to