cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Data Models from data base

Former Member
0 Kudos

I am new to hybris and working my way through the developer trail: I had a question. If I have an existing schema how can I generate the model and stuff for the item xml?

In this section how can you generate the model from a schema instead of defining in your xml? Trail ~ New Data Model

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

How many tables are we talking about here? I would be weary about scripting the conversion to items.xml. You could use the conversion as a starting point however you really want to get in and makes the appropriate changes to items.xml directly because there are some hybris specifics that are not going to be in your schema or a different enough that you want to manually make the changes e.g. relations, read/write/mandatory modifiers, unique attributes, enumerations.

If you understand the type system and items.xml and you already have the data model defined you should be able to crank out a reasonably complicated data model into items.xml in less than a day.

Former Member
0 Kudos

Ok that is not super great but If I have an existing schema I could write a script to create the *-items.xml from the existing table database model and then run the build.

Former Member
0 Kudos

Thank would be great thing for you. The purpose of items.xml is to abstract the underlying database. For example you change you db then you simply do ant initialize and get all your tables back. Hybris generates table creation script from items.xml and runs it on db. If you can write a script to generate items.xml then you are good to do.

Former Member
0 Kudos

Hi Christie, Hybris does not support this kind of feature. If you got something to add to data base, *-items.xml has to be updated which generates the required models once you build it.