ormlite store unknown foreign object in DatabaseField

↘锁芯ラ 提交于 2019-12-13 02:31:19

问题


For example :

i need an Animals table which will contain animal_type as Object or T type as foreign relation field.

then i will have 10 different tables like Dog/Cat/Horse etc.

at the time of insertion based on type of animal i would set animal_type of Animal object.

I don't want to take multiple databaseField for each type as a foreign relation, instead i need one generic field , Using ormlite version 5.0.

please refer this json:{ "animal": { "type": 1, "content": { "items": [ { "title": "Image", "desc": "This is item with image", "media": { "url": "https://upload.wikimedia.org/wikipedia/commons/9/99/Earth_rise_from_the_Moon_AS11-44-6550_2.JPG", "type": 0 }, "options": [ { "title": "View", "value": "view" }, { "title": "Download", "value": "download" } ], "url": "https://commons.wikimedia.org/wiki/File%3AEarth_rise_from_the_Moon_AS11-44-6550_2.JPG" } ] } } }

来源:https://stackoverflow.com/questions/45989326/ormlite-store-unknown-foreign-object-in-databasefield

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!