[ 
https://issues.apache.org/jira/browse/TOMEE-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla closed TOMEE-1380.
----------------------------------
    Fix Version/s: 10.0.0
       Resolution: Fixed

> study a better data importer for datsources and entitymanagers
> --------------------------------------------------------------
>
>                 Key: TOMEE-1380
>                 URL: https://issues.apache.org/jira/browse/TOMEE-1380
>             Project: TomEE
>          Issue Type: New Feature
>            Reporter: Romain Manni-Bucau
>            Assignee: Evaldo Junior
>            Priority: Minor
>             Fix For: 10.0.0, 10.0.0-M3
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Today we can import sql files when sql is inline but since javaee 7 
> introduces json API we should be able to use json (even xml) to do it.
> Formats could be:
> - for datasources (<datasource>.json in classpath or 
> $tomee_base/data/<datasource>.json):
> {code}
> {
>    "configuration":{
>        "rollbackIfError": false, // only for jta datasources
>    },
>    "data":{
>       "table1":[
>          {
>              "column1":"value1",
>              "column2":"value2"
>         },
>         {
>              "column1":"value1"
>         }
>       ],
>       "table2":[
>          {
>              "column3":"value"
>         }
>       ]
>    }
> }
> {code}
> - and for entitymanagers:
> {code}
> {
>    "configuration":{
>        "rollbackIfError": false, // only for jta datasources
>    },
>    "data":{
>       "org.superbiz.Entity1":[
>          {
>              "field1":"value1",
>              "field2":"value2"
>         },
>         {
>              "field1":"value1"
>         }
>       ],
>       "org.superbiz.Entity2":[
>          {
>              "field3":"value"
>         }
>       ]
>    }
> }
> {code}
> Tests: should ensure manual inserts works but also for entitymanager case 
> that relationships (n-m and 1-n) work. Since we have the em we can get the 
> metamodel to determine the keys and relationships so it doesn't sound 
> impossible.



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

Reply via email to