Easy import/export (xml?) of specifics
Posted: Tue May 29, 2012 11:55 am
Hi,
I wrote a nice generic model (somewhat similar to the SimpleService tutorial) for generation of objects for hibernate-orm. I already have a project with generated sourcecode for these objects; the source of that generator is xml.
I want to 'import' these definitions to my new project; I was hoping I could make an import-xml-template based on my model; and then convert my other xml to this template; and then load it. As I have over 400 object-types averaging 10-30 attributes and 0-5 relations, it is a lot of work to do it by hand.
To give some extra context, I have these classes:
Entity, Relation, Attribute(name, column, required, length)
Entity has 0..N Relations
Entity has 0..N Attributes
My previous xml looks somewhat like this:
<entity name="">
<attribute name="" column=""> ....
<relation name="" entity="" type=""></relation>...
</entity>
I wrote a nice generic model (somewhat similar to the SimpleService tutorial) for generation of objects for hibernate-orm. I already have a project with generated sourcecode for these objects; the source of that generator is xml.
I want to 'import' these definitions to my new project; I was hoping I could make an import-xml-template based on my model; and then convert my other xml to this template; and then load it. As I have over 400 object-types averaging 10-30 attributes and 0-5 relations, it is a lot of work to do it by hand.
To give some extra context, I have these classes:
Entity, Relation, Attribute(name, column, required, length)
Entity has 0..N Relations
Entity has 0..N Attributes
My previous xml looks somewhat like this:
<entity name="">
<attribute name="" column=""> ....
<relation name="" entity="" type=""></relation>...
</entity>