hibernate - Any frameworks for dynamically creating schema on-the-fly to support adhoc JSON object map persistence? -
here requirement trying nail down - there incoming json data represents object map (think nested objects, each having 1 or more attributes) need persist in database. problem not know attributes going come-in in json data. need dynamically build tables columns when data comes-in , okay create string type columns start with. if next request has more attributes given object-type, or, less attributes, different set of attributes, corresponding table created earlier should automatically expanded add new columns , allow persistence of incoming json data. nested objects, each object should go separate table , okay if sort of join or mapping table gets created additionally maintain mapping between two. objects have static "id" attribute, may have numeric number. needs treated specially, in sense object having no "id" attribute should considered "new" object, hence row insert should performed, , id should generated object during persistence. if object has "id" attribute populated, should considered update operation. there special attribute called "tobedeleted=true|false" may show in json object map, should end triggering (cascade) delete on object identified id.
now here question: there or mapping framework, allows on-the-fly expanding schema persist incoming attributes? has dealt kind of requirement schema not fixed , needs expand on fly accommodate incoming data - there frameworks support type of json persistence behavior?
keep in mind, trying not create tables key/value columns store attributes , values each object, because results in 'tall' tables, don't perform retrieval performance. see each attribute getting persisted in it's own column, not row in key/value pair type table.
it sounds you're trying make orm store data it's not designed store, more of flat db or document store. reconsider design sounds mongo more suited you're asking out of box.
Comments
Post a Comment