[teiid-issues] [JBoss JIRA] (TEIIDSB-105) Modelling a Json entitty with array of "details"

Ramesh Reddy (Jira) issues at jboss.org
Thu Jun 13 11:23:00 EDT 2019


    [ https://issues.jboss.org/browse/TEIIDSB-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13746474#comment-13746474 ] 

Ramesh Reddy commented on TEIIDSB-105:
--------------------------------------

In general none of the array based fragments other than simple arrays were working earlier due to an issue with code. That has been fixed now, when the entity is used with @OneToMany from Parent entity and @ManyToOne from child entity, if you define the @Id as the join key itself (as the json will not have id duplicated in child fragments as in relational tables) then data is read correctly into respective entities. For a complete example see https://github.com/teiid/teiid-spring-boot/tree/master/samples/json

> Modelling a Json entitty with array of "details"
> ------------------------------------------------
>
>                 Key: TEIIDSB-105
>                 URL: https://issues.jboss.org/browse/TEIIDSB-105
>             Project: Teiid Spring Boot
>          Issue Type: Bug
>          Components: JPA
>            Reporter: Ramesh Reddy
>            Assignee: Ramesh Reddy
>            Priority: Major
>             Fix For: 1.2.0
>
>
> When using the @JsonTable the construct only supports reading the array type of same data types, with mixed type it does not work. For ex:
> {code}
> [1, 1, 3]
> {code}
> works, but 
> {code}
> [1, "two", 3.0]
> {code}
> does not work. If the user chooses to read it as a string array converting the values to match Teiid semantics it is not possible. However, when it is created as
> {code}
> { id: 1, desc: "two", weight: 3.0}
> {code}
> can be read an entity. The array form could also be modeled as an entity with single parameter as `string[]`



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the teiid-issues mailing list