[ 
https://issues.apache.org/jira/browse/FINERACT-1911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17751910#comment-17751910
 ] 

Peter Santa commented on FINERACT-1911:
---------------------------------------

Márta Jankovics 
13 hours ago
Edited
 
 
General changes for data tables.
 * Make the datatable read/write actions more type safe.
Instead of reading and comparing string literals as database types, eg.
{{ResultsetColumnHeaderData}}
 {{}}
{{    public boolean isDateTimeDisplayType() {}}{{        return 
"DATETIME".equalsIgnoreCase(this.columnDisplayType);}}
 * 
{{    }}}

changed to type safe enums
 {{}}
{{    public boolean isDateTimeDisplayType() {}}{{        return 
columnDisplayType == DisplayType.DATETIME;}}
{{    }}}
In order to fulfil this, there were new types introduced
{{{}org.apache.fineract.infrastructure.core.service.database{}}}.{{{}JdbcJavaType{}}}
{{{}org.apache.fineract.infrastructure.core.service.database{}}}.{{{}JavaType{}}}

These enums are able to recognise/compare/parse/format database types for the 
currently supported database dialects: mysql, postgresql, and can be extended 
to other dialects on need.

Some code could be still more enhanced, like 
{{{}ResultsetColumnHeaderData{}}}.{{{}adjustColumnType{}}}
 * Availability to connect data tables to the application table by a 
configurable database field instead of the application table generated primary 
key.
Reason: Datatable support was added for Savings Transactions, but the generated 
key of the transactions could be invalidated on Savings Account reschedule. 
(Old transactions could be replaced by new transactions with different primary 
keys). To keep the referential integrity, there is a need to link the 
datatables for this entity through an external key (which never changes).

 ** First step to support this was to add new property to 
org.apache.fineract.infrastructure.dataqueries.data.EntityTables
 {{}}

 * 
{{private final String refColumn; // referenced column name on apptable}}
 * Add new property in EntityTables
This way it is possible to introduce several entity types mapped to the same 
application table (GROUP/CENTER)
 {{}}

 * 
{{private final String apptableName;}}
 * Additionally we made sure that everywhere in the code the string based logic 
was replaced by the use of EntityTables
 {{}}

{{if ("m_center".equalsIgnoreCase(appTable))}}{{to}}
 * 
 ** 
{{EntityTables.CENTER == appTable}}
 * Utility classes 
{{{}org.apache.fineract.infrastructure.core.service{}}}.{{{}MathUtil{}}}
{{{}org.apache.fineract.infrastructure.core.service{}}}.{{{}DateUtils{}}}
were moved to common packages and extended by new util methods.
Some of the new methods are not used yet, but during the code clean-up we would 
like to use these utils more and more.

 * Validation and sql build support methods added :
{{{}org.apache.fineract.infrastructure.core.service.database{}}}.{{{}DatabaseSpecificSQLGenerator{}}}

 * Support for generic search:
{{{}org.apache.fineract.infrastructure.core.service.database{}}}.{{{}SqlOperator{}}}
{{{}org.apache.fineract.portfolio.search.service{}}}.{{{}SearchUtil{}}}

 * Enhanced existing unit/integration tests:
{{{}org.apache.fineract.infrastructure.dataqueries.service{}}}.ReadWriteNonCoreDataServiceImplTest.java
{{{}org.apache.fineract.integrationtests.datatable.{}}}DatatableIntegrationTest.java
{{{}org.apache.fineract.integrationtests.common.organisation{}}}.EntityDatatableChecksIntegrationTest.java

> Assign Data Table to Transaction (Savings)
> ------------------------------------------
>
>                 Key: FINERACT-1911
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1911
>             Project: Apache Fineract
>          Issue Type: New Feature
>          Components: Data Tables
>            Reporter: Peter Santa
>            Assignee: Muthu
>            Priority: Major
>              Labels: BeanSalad
>
> h1. Background
> Currently data tables can be assigned to several entity types, but 
> transaction is not an option.
> h1. Goal
> The context is mainly Transactions of {*}Saving Accounts{*}, but it would be 
> great to implement the feature generally.
> The goal would be to make it possible to
>  * {*}assign data table to transactions{*}, and
>  * support multi-row and single-row tables - as it is already supported for 
> data tables that could be assigned to other entities.
> h1. Acceptance Criteria
>  * it is supported to assign *data tables to Transaction entities* of - at 
> least - savings accounts, and the solution fits into the current data table 
> conception



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to