Same named element in 2 different xsd [message #82580] |
Tue, 08 May 2007 10:35  |
Eclipse User |
|
|
|
Hi Martin,
I have the same named element "ParentTree" in 2 different xsds eg
navigation.xsd and topology.xsd. Navigation.xsd reference topology.xsd. So
when I try a datastore.initialize, teneo finds the same eClass in
"ParentTree" in navigation and topology. Is there a way around this? Can I
redirect one of the ParentTree to point to a different table in the
database without explicitly changing the xsd?
Julia
|
|
|
|
|
|
Re: Same named element in 2 different xsd [message #82700 is a reply to message #82649] |
Wed, 09 May 2007 08:17  |
Eclipse User |
|
|
|
Hi Martin,
May be at some stage teneo can implement some extension point so that
one can set these options in Window -> Preferences... for teneo.
Regards,
Parvez
Martin Taal wrote:
> Hi Julia,
> I would assume that they are conceptually different (as they are
> modelled each as their own type).
> So in this case they would need different tables.
>
> To solve the duplicate eclass name issue (when generating the jdo file)
> the best is to set the following property
> PersistenceOptions.QUALIFY_ENTITY_NAME
> to
> PersistenceOptions.QUALIFY_ENTITY_NAME_NSPREFIX);
>
> This property must be set to generate the jdo file. However passing
> properties can not be done for the right-click menu-generate-jdo option.
> You have to generate the jdo file programmatically. This is not
> difficult, just make a class with a static main method in your model
> project and call the following method:
> JpoxHelper.INSTANCE.generateMapping(your_epackages, options)
>
> this will return the jdo file.
>
> gr. Martin
>
> Julia wrote:
>> Hi Martin,
>>
>> Actually, it's the same named element and structure in both xsds but
>> will hold different data. Would I not need 2 different tables in the
>> datastore? Would changing the table="ParentTree" to
>> table="ParentTree_nav" in package.jdo for one of the xsds work? It's
>> probably a hack :-). Would following the links you provided work in
>> this case?
>>
>> Julia
>>
>
>
|
|
|
Re: Same named element in 2 different xsd [message #606632 is a reply to message #82580] |
Tue, 08 May 2007 14:39  |
Eclipse User |
|
|
|
Hi Julia,
If the problem is that both eclasses are stored in the same table then you can use an
@Table(name="myname") annotation on the eclass to control were it is stored. You can set this
annotation in the xsd, the ecore or in a separate xml file.
See here for some extra info:
http://www.elver.org/jpox/ejb3_features.html
http://www.elver.org/jpox/ejb3_format.html
http://www.elver.org/jpox/ejb3_examples.html
gr. Martin
Julia wrote:
> Hi Martin,
>
> I have the same named element "ParentTree" in 2 different xsds eg
> navigation.xsd and topology.xsd. Navigation.xsd reference topology.xsd.
> So when I try a datastore.initialize, teneo finds the same eClass in
> "ParentTree" in navigation and topology. Is there a way around this? Can
> I redirect one of the ParentTree to point to a different table in the
> database without explicitly changing the xsd?
>
> Julia
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Same named element in 2 different xsd [message #606633 is a reply to message #82628] |
Tue, 08 May 2007 17:34  |
Eclipse User |
|
|
|
Hi Martin,
Actually, it's the same named element and structure in both xsds but will
hold different data. Would I not need 2 different tables in the datastore?
Would changing the table="ParentTree" to table="ParentTree_nav" in
package.jdo for one of the xsds work? It's probably a hack :-). Would
following the links you provided work in this case?
Julia
|
|
|
Re: Same named element in 2 different xsd [message #606634 is a reply to message #82639] |
Wed, 09 May 2007 01:03  |
Eclipse User |
|
|
|
Hi Julia,
I would assume that they are conceptually different (as they are modelled each as their own type).
So in this case they would need different tables.
To solve the duplicate eclass name issue (when generating the jdo file) the best is to set the
following property
PersistenceOptions.QUALIFY_ENTITY_NAME
to
PersistenceOptions.QUALIFY_ENTITY_NAME_NSPREFIX);
This property must be set to generate the jdo file. However passing properties can not be done for
the right-click menu-generate-jdo option. You have to generate the jdo file programmatically. This
is not difficult, just make a class with a static main method in your model project and call the
following method:
JpoxHelper.INSTANCE.generateMapping(your_epackages, options)
this will return the jdo file.
gr. Martin
Julia wrote:
> Hi Martin,
>
> Actually, it's the same named element and structure in both xsds but
> will hold different data. Would I not need 2 different tables in the
> datastore? Would changing the table="ParentTree" to
> table="ParentTree_nav" in package.jdo for one of the xsds work? It's
> probably a hack :-). Would following the links you provided work in this
> case?
>
> Julia
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: Same named element in 2 different xsd [message #606639 is a reply to message #82649] |
Wed, 09 May 2007 08:17  |
Eclipse User |
|
|
|
Hi Martin,
May be at some stage teneo can implement some extension point so that
one can set these options in Window -> Preferences... for teneo.
Regards,
Parvez
Martin Taal wrote:
> Hi Julia,
> I would assume that they are conceptually different (as they are
> modelled each as their own type).
> So in this case they would need different tables.
>
> To solve the duplicate eclass name issue (when generating the jdo file)
> the best is to set the following property
> PersistenceOptions.QUALIFY_ENTITY_NAME
> to
> PersistenceOptions.QUALIFY_ENTITY_NAME_NSPREFIX);
>
> This property must be set to generate the jdo file. However passing
> properties can not be done for the right-click menu-generate-jdo option.
> You have to generate the jdo file programmatically. This is not
> difficult, just make a class with a static main method in your model
> project and call the following method:
> JpoxHelper.INSTANCE.generateMapping(your_epackages, options)
>
> this will return the jdo file.
>
> gr. Martin
>
> Julia wrote:
>> Hi Martin,
>>
>> Actually, it's the same named element and structure in both xsds but
>> will hold different data. Would I not need 2 different tables in the
>> datastore? Would changing the table="ParentTree" to
>> table="ParentTree_nav" in package.jdo for one of the xsds work? It's
>> probably a hack :-). Would following the links you provided work in
>> this case?
>>
>> Julia
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.25168 seconds