Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #112457] Sat, 16 February 2008 12:43 Go to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
See inline (MT>>>).

gr. Martin

Daniel Gerlach wrote:
> org.eclipse.emf.teneo.TeneoException: The dbid
>
http://docs.active-endpoints.com/activebpel/sample/wsdl/flig htTrackerService/2006/07/flightTrackerService.wsdl/DocumentR oot/FlightHistory

> and nsuri:
>
http://docs.active-endpoints.com/activebpel/sample/wsdl/flig htTrackerService/2006/07/flightTrackerService.wsdl

> does not resolve to an epackage
> (...)
>
> Is there a possible workaround to grab the EObjects which don't belongs
> to an registerd EPackage and save them as BLOBs in the database in a
> special table.
MT>> No this is currently not possible, Teneo assumes that all eobjects belong a registered
epackage. If you enter a bugzilla for this then I can see what I can do. But to be realistic, it is
a fair amount of work so it will take a while (> 1 month) before I can pick this up.

>
> 2. Because im am not tied to a special OR-Mapper, i tried JPOX 1.19 with
> Teneo, which according to elver.org supports "xsd:any". But here, i get
> an exception when i am creating the corresponding package.jdo for the
> given ecore. The exception happens when i programmaticly create the
> mapping and also from the eclipse/JPOX plugin- menu.
MT>> Hmm, I would need to debug this to see what happens. For one reason or another my news reader
(thunderbird) gets confused by your post. So I see the attachment content inline and can't download
them. Can you send them to me directly (mtaal@elver.org)?
But for jpox the same limitation as for hibernate applies, the epackage to which you refer should be
registered with Teneo.

>
> (...)
> 523 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.OneToManyReferenceA nnotator -
> EReference + correlation/Correlations does not have a onetomany
> annotation, adding one
> 523 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.OneToManyReferenceA nnotator -
> Setting indexed and unique from ereference because otm was not set manually!
> 523 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator - Creating
> mapping for eclass CorrelationSet
> 523 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator - Adding
> default annotations for EClass: CorrelationSet
> 524 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator - Setting the
> superentity of the eclass
> 524 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.SingleAttributeAnno tator -
> Adding default annotations for EAttribute name
> 524 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.OneToManyAttributeA nnotator -
> EAttribute properties/CorrelationSet needs a onetomany
> 524 [main] DEBUG
> org.eclipse.emf.teneo.annotations.mapper.OneToManyAttributeA nnotator -
> One to many not present adding one
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.teneo.util.EcoreDataTypes.getTargetTypeName( EcoreDataTypes.java:117)
> at
>
org.eclipse.emf.teneo.annotations.mapper.BaseEFeatureAnnotat or.getTargetTypeName(BaseEFeatureAnnotator.java:168)
> at
>
org.eclipse.emf.teneo.annotations.mapper.OneToManyAttributeA nnotator.annotate(OneToManyAttributeAnnotator.java:100)
> at
> org.eclipse.emf.teneo.annotations.mapper.EFeatureAnnotator.a nnotate(EFeatureAnnotator.java:135)
> at
> org.eclipse.emf.teneo.annotations.mapper.EClassAnnotator.ann otate(EClassAnnotator.java:223)
> at
>
org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .processPackage(AnnotationGenerator.java:167)
> at
> org.eclipse.emf.teneo.annotations.mapper.AnnotationGenerator .map(AnnotationGenerator.java:135)
> at
>
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:142)
> at
>
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:66)
> at
> org.eclipse.emf.teneo.jpox.JpoxHelper.generateMapping(JpoxHe lper.java:162)
> at
> org.eclipse.emf.teneo.jpox.JpoxHelper.generateMapping(JpoxHe lper.java:153)
> at test.TestJpox.genMappingFile(TestJpox.java:54)
> at test.TestJpox.main(TestJpox.java:21)
>
>
> I have debugged a little bit and it seems the list of eClassifiers in
> the EcoreDataTypes.class has one entry which is set to null. But i
> haven't any clue what's happening here.....
>
>
> 3. One last little question:
>
> Hibernate offers to load an object from the database with the objectID:
>
> Code:
>
> session.load(objectID);
>
> or
>
> session.get(objectID);
>
> The context here is, that i work with detached objects and after the
> work is done, i want to reload these objects. I get the ID with
> IdentifierCacheHandler.getID(), but how can i load the objects with it.
>
> Is this possible in Teneo, or should i use a normal query to get the
> objects again?
MT>> The id which you get back from the IdentifierCacheHandler can be used as a normal id in
hibernate. Note the identifiercachehandler only works if your objects have stayed in-memory all the
time. So for example if you send them over the wire (in a client-server scenario) and get them back
then it won't work (as the object is a different instance in memory).

>
> Thanks in advance,
>
> Daniel Gerlach
>
>

--

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: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #112470 is a reply to message #112457] Sat, 16 February 2008 13:04 Go to previous messageGo to next message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Hi Martin,

i have send you the files to your eMail.


Daniel Gerlach
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #112482 is a reply to message #112470] Sun, 17 February 2008 12:23 Go to previous messageGo to next message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------060108050803070505060106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

now after a little bit of testing, i understand that Teneo only persists
EObjects which are registered EPackages in the DataStore.

But what about the EObjects which are resolved as EMF AnyTypes (see
http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava)?
Is there any possibility to save them as BLOB in the database in a
special table?

I have created a simple example which describe my problem:

- i have 2 XSDs person.xsd and the children.xsd.

- i have also 2 xml files which should be persisted in the database:
normalPerson.xml and the PersonWithUsedXSD_AnyElement.xml.

(All files are attached to this eMail)

The person.xsd has an "xsd:any" element. Now i created an EPackage from
the person.xsd, a hibernate mapping file with teneo and exported the
schema to the database.

After that i wanted to persist the normalPerson.xml. Everything works.

But when i wanted to persisted the PersonWithUsedXSD_AnyElement.xml, i
got an error, because the children.xsd hasn't got a corresponding EPackage.

It would be nice, if you could look into it. Perhaps there is a manually
workaround. At the moment i delete all EMF AnyTypes manually in order to
save them into the database, but that is not really a solution....

Greetings

Daniel Gerlach

person.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="www.gerry.de"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="www.gerry.de" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="person">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="firstname" type="xs:string"/>
<xs:any namespace="##any" processContents="lax" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

children.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<xs:schema xmlns="www.gerrry.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="www.gerrry.com" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="children">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="childname" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

normalPerson.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<person xmlns="www.gerry.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.gerry.de person.xsd">
<lastname>Gerlach</lastname>
<firstname>Daniel</firstname>
</person>

PersonWithUsedXSD_AnyElement.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<person xmlns="www.gerry.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.gerry.de person.xsd www.gerrry.com children.xsd">
<lastname>tommy</lastname>
<firstname>jkerov</firstname>
<children>
<childname>cecile</childname>
</children>
</person>

--------------060108050803070505060106
Content-Type: application/zip;
name="exampleFiles.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="exampleFiles.zip"

UEsDBBQAAAAIABxfUTg5eWuXXQEAAIECAAAMAAAAY2hpbGRyZW4ueHNkdVG7 bgIxEKwTKf+w
cQXFcZA0CEEogkiTRxGQ0hrfwlny4/CDu/v7rHmEEJTOO7s7M54dTxutYIfO S2smbNDrM0Aj
bCHNZsKWi3k2ZNOnu9vxfZYBFjJgAbUMJXy9vX5WLewe+v0h+GoAnTKEapTn dV33uAp2x3vC
6i6sWphxI1HBCzrFRQmdpZGp6EKWJerGj7woUXMgL8ZPWKLYoHOuTRTsAI8a 6vzSqB971m1y
0h/kycyegUHgboPhnWv0FRd4TYYKNZowt07PcM2jChO2jVzJtcSCAQ/ByVUM eDEQzXmELN8k
z0ciMFyTjCilKhyafXvf58bYwAPlmqADVlgRaekIP1u9ZyjQCxKlyKG10YGz Npx8jvO/aweB
/ELhR5S+WClsFm2FZ1WP20hHPSL/mU9Pyq+tCEhLwZEhBpo3H0JE51MKKxtN QRnkR/L8kj0h
VyYIOwtSTeXp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8LDZbMH1Baxa
7/uS0nEcc668GXguTLeGzxmeuJao4AWt4qKF1VHLCNaQZTG6D+1GQxiiXUXi fYPWznmN5ESW
k5MVucgfH3NjGxq6CxqHiBY7nkntPNciXAV/6RJ5MIL78LXrXDhV5pOrYeGD EPeCaKWqLSaN
hHU3THHnNe9w503XzYyecRK/pF3Q9w9aMzAamX/9HBfBgpImUEiFjCbmz00v 7IymkfH5C1BL
AQIUABQAAAAIABxfUTg5eWuXXQEAAIECAAAMAAAAAAAAAAAAIAAAAAAAAABj aGlsZHJlbi54
c2RQSwECFAAUAAAACACuZFE4n2p9GOQAAABPAQAAEAAAAAAAAAAAACAAAACH AQAAbm9ybWFs
UGVyc29uLnhtbFBLAQIUABQAAAAIANdhUTgX6urYPwEAAIMCAAAKAAAAAAAA AAAAIAAAAJkC
AABwZXJzb24ueHNkUEsBAhQAFAAAAAgAtGRROCcLVkAGAQAApQEAACAAAAAA AAAAAAAgAAAA
AAQAAFBlcnNvbldpdGhVc2VkWFNEX0FueUVsZW1lbnQueG1sUEsFBgAAAAAE AAQA/gAAAEQF
AAAAAA==
--------------060108050803070505060106--
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #112494 is a reply to message #112482] Sun, 17 February 2008 13:39 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
There is currently no manual workaround for this. Can you open a bugzilla for this and attach your
example to it? As said in the other post it can be some work and I am not sure if I have time to do
this before eclipsecon but I will do my best.

gr. Martin

Daniel Gerlach wrote:
> Hi,
>
> now after a little bit of testing, i understand that Teneo only persists
> EObjects which are registered EPackages in the DataStore.
>
> But what about the EObjects which are resolved as EMF AnyTypes (see
> http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava)?
> Is there any possibility to save them as BLOB in the database in a
> special table?
>
> I have created a simple example which describe my problem:
>
> - i have 2 XSDs person.xsd and the children.xsd.
>
> - i have also 2 xml files which should be persisted in the database:
> normalPerson.xml and the PersonWithUsedXSD_AnyElement.xml.
>
> (All files are attached to this eMail)
>
> The person.xsd has an "xsd:any" element. Now i created an EPackage from
> the person.xsd, a hibernate mapping file with teneo and exported the
> schema to the database.
>
> After that i wanted to persist the normalPerson.xml. Everything works.
>
> But when i wanted to persisted the PersonWithUsedXSD_AnyElement.xml, i
> got an error, because the children.xsd hasn't got a corresponding EPackage.
>
> It would be nice, if you could look into it. Perhaps there is a manually
> workaround. At the moment i delete all EMF AnyTypes manually in order to
> save them into the database, but that is not really a solution....
>
> Greetings
>
> Daniel Gerlach
>
> person.xsd:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns="www.gerry.de"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="www.gerry.de" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="person">
> <xs:annotation>
> <xs:documentation>Comment describing your root
> element</xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:element name="lastname" type="xs:string"/>
> <xs:element name="firstname" type="xs:string"/>
> <xs:any namespace="##any" processContents="lax"
> minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> children.xsd:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <xs:schema xmlns="www.gerrry.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="www.gerrry.com" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="children">
> <xs:annotation>
> <xs:documentation>Comment describing your root
> element</xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:element name="childname" type="xs:string"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> normalPerson.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <person xmlns="www.gerry.de"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="www.gerry.de person.xsd">
> <lastname>Gerlach</lastname>
> <firstname>Daniel</firstname>
> </person>
>
> PersonWithUsedXSD_AnyElement.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <person xmlns="www.gerry.de"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="www.gerry.de person.xsd www.gerrry.com children.xsd">
> <lastname>tommy</lastname>
> <firstname>jkerov</firstname>
> <children>
> <childname>cecile</childname>
> </children>
> </person>


--

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: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #112507 is a reply to message #112494] Sun, 17 February 2008 14:25 Go to previous message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Thank you for looking at it!

I need this for my Diploma Thesis, and i only implement a prototype, thus
how it works now, it is ok, so it isn't urgent. But it would be a nice
feature if one can persist every "xsd:any" element from a given XML-Schema
without registering it with an EPackage.

I will open a bugzilla. I hope this isn't hard, cause this is my first
one:)

Greetings

Daniel Gerlach
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #615502 is a reply to message #112457] Sat, 16 February 2008 13:04 Go to previous message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Hi Martin,

i have send you the files to your eMail.


Daniel Gerlach
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #615503 is a reply to message #112470] Sun, 17 February 2008 12:23 Go to previous message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------060108050803070505060106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

now after a little bit of testing, i understand that Teneo only persists
EObjects which are registered EPackages in the DataStore.

But what about the EObjects which are resolved as EMF AnyTypes (see
http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava)?
Is there any possibility to save them as BLOB in the database in a
special table?

I have created a simple example which describe my problem:

- i have 2 XSDs person.xsd and the children.xsd.

- i have also 2 xml files which should be persisted in the database:
normalPerson.xml and the PersonWithUsedXSD_AnyElement.xml.

(All files are attached to this eMail)

The person.xsd has an "xsd:any" element. Now i created an EPackage from
the person.xsd, a hibernate mapping file with teneo and exported the
schema to the database.

After that i wanted to persist the normalPerson.xml. Everything works.

But when i wanted to persisted the PersonWithUsedXSD_AnyElement.xml, i
got an error, because the children.xsd hasn't got a corresponding EPackage.

It would be nice, if you could look into it. Perhaps there is a manually
workaround. At the moment i delete all EMF AnyTypes manually in order to
save them into the database, but that is not really a solution....

Greetings

Daniel Gerlach

person.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="www.gerry.de"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="www.gerry.de" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="person">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="firstname" type="xs:string"/>
<xs:any namespace="##any" processContents="lax" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

children.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<xs:schema xmlns="www.gerrry.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="www.gerrry.com" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:element name="children">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="childname" type="xs:string" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

normalPerson.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<person xmlns="www.gerry.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.gerry.de person.xsd">
<lastname>Gerlach</lastname>
<firstname>Daniel</firstname>
</person>

PersonWithUsedXSD_AnyElement.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
Gerlach (Uni Ger) -->
<person xmlns="www.gerry.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="www.gerry.de person.xsd www.gerrry.com children.xsd">
<lastname>tommy</lastname>
<firstname>jkerov</firstname>
<children>
<childname>cecile</childname>
</children>
</person>

--------------060108050803070505060106
Content-Type: application/zip;
name="exampleFiles.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="exampleFiles.zip"

UEsDBBQAAAAIABxfUTg5eWuXXQEAAIECAAAMAAAAY2hpbGRyZW4ueHNkdVG7 bgIxEKwTKf+w
cQXFcZA0CEEogkiTRxGQ0hrfwlny4/CDu/v7rHmEEJTOO7s7M54dTxutYIfO S2smbNDrM0Aj
bCHNZsKWi3k2ZNOnu9vxfZYBFjJgAbUMJXy9vX5WLewe+v0h+GoAnTKEapTn dV33uAp2x3vC
6i6sWphxI1HBCzrFRQmdpZGp6EKWJerGj7woUXMgL8ZPWKLYoHOuTRTsAI8a 6vzSqB971m1y
0h/kycyegUHgboPhnWv0FRd4TYYKNZow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C0ZFE4JwtWQAYBAAClAQAAIAAAAFBlcnNvbldpdGhVc2VkWFNE X0FueUVsZW1l
bnQueG1sVU+7TsMwFJ1B4h8untohcQNLFTntgmApE1RiNc4lMTh2ZFt5/D22 m0K7+TzuOcds
P3UKBrROGl2RIt8QQC1MLXVTkeP7c7Yl+93dLbvPMsBaeqxhlL6Fj9fDWz/D 8LDZbMH1Baxa
7/uS0nEcc668GXguTLeGzxmeuJao4AWt4qKF1VHLCNaQZTG6D+1GQxiiXUXi fYPWznmN5ESW
k5MVucgfH3NjGxq6CxqHiBY7nkntPNciXAV/6RJ5MIL78LXrXDhV5pOrYeGD EPeCaKWqLSaN
hHU3THHnNe9w503XzYyecRK/pF3Q9w9aMzAamX/9HBfBgpImUEiFjCbmz00v 7IymkfH5C1BL
AQIUABQAAAAIABxfUTg5eWuXXQEAAIECAAAMAAAAAAAAAAAAIAAAAAAAAABj aGlsZHJlbi54
c2RQSwECFAAUAAAACACuZFE4n2p9GOQAAABPAQAAEAAAAAAAAAAAACAAAACH AQAAbm9ybWFs
UGVyc29uLnhtbFBLAQIUABQAAAAIANdhUTgX6urYPwEAAIMCAAAKAAAAAAAA AAAAIAAAAJkC
AABwZXJzb24ueHNkUEsBAhQAFAAAAAgAtGRROCcLVkAGAQAApQEAACAAAAAA AAAAAAAgAAAA
AAQAAFBlcnNvbldpdGhVc2VkWFNEX0FueUVsZW1lbnQueG1sUEsFBgAAAAAE AAQA/gAAAEQF
AAAAAA==
--------------060108050803070505060106--
Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #615504 is a reply to message #112482] Sun, 17 February 2008 13:39 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Daniel,
There is currently no manual workaround for this. Can you open a bugzilla for this and attach your
example to it? As said in the other post it can be some work and I am not sure if I have time to do
this before eclipsecon but I will do my best.

gr. Martin

Daniel Gerlach wrote:
> Hi,
>
> now after a little bit of testing, i understand that Teneo only persists
> EObjects which are registered EPackages in the DataStore.
>
> But what about the EObjects which are resolved as EMF AnyTypes (see
> http://www.theserverside.com/tt/articles/article.tss?l=Bindi ngXMLJava)?
> Is there any possibility to save them as BLOB in the database in a
> special table?
>
> I have created a simple example which describe my problem:
>
> - i have 2 XSDs person.xsd and the children.xsd.
>
> - i have also 2 xml files which should be persisted in the database:
> normalPerson.xml and the PersonWithUsedXSD_AnyElement.xml.
>
> (All files are attached to this eMail)
>
> The person.xsd has an "xsd:any" element. Now i created an EPackage from
> the person.xsd, a hibernate mapping file with teneo and exported the
> schema to the database.
>
> After that i wanted to persist the normalPerson.xml. Everything works.
>
> But when i wanted to persisted the PersonWithUsedXSD_AnyElement.xml, i
> got an error, because the children.xsd hasn't got a corresponding EPackage.
>
> It would be nice, if you could look into it. Perhaps there is a manually
> workaround. At the moment i delete all EMF AnyTypes manually in order to
> save them into the database, but that is not really a solution....
>
> Greetings
>
> Daniel Gerlach
>
> person.xsd:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns="www.gerry.de"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="www.gerry.de" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="person">
> <xs:annotation>
> <xs:documentation>Comment describing your root
> element</xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:element name="lastname" type="xs:string"/>
> <xs:element name="firstname" type="xs:string"/>
> <xs:any namespace="##any" processContents="lax"
> minOccurs="0"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> children.xsd:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <xs:schema xmlns="www.gerrry.com"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> targetNamespace="www.gerrry.com" elementFormDefault="qualified"
> attributeFormDefault="unqualified">
> <xs:element name="children">
> <xs:annotation>
> <xs:documentation>Comment describing your root
> element</xs:documentation>
> </xs:annotation>
> <xs:complexType>
> <xs:sequence>
> <xs:element name="childname" type="xs:string"
> maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema>
>
> normalPerson.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <person xmlns="www.gerry.de"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="www.gerry.de person.xsd">
> <lastname>Gerlach</lastname>
> <firstname>Daniel</firstname>
> </person>
>
> PersonWithUsedXSD_AnyElement.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- edited with XMLSpy v2008 sp1 (http://www.altova.com) by Daniel
> Gerlach (Uni Ger) -->
> <person xmlns="www.gerry.de"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="www.gerry.de person.xsd www.gerrry.com children.xsd">
> <lastname>tommy</lastname>
> <firstname>jkerov</firstname>
> <children>
> <childname>cecile</childname>
> </children>
> </person>


--

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: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem [message #615505 is a reply to message #112494] Sun, 17 February 2008 14:25 Go to previous message
Daniel Gerlach is currently offline Daniel GerlachFriend
Messages: 36
Registered: July 2009
Member
Thank you for looking at it!

I need this for my Diploma Thesis, and i only implement a prototype, thus
how it works now, it is ok, so it isn't urgent. But it would be a nice
feature if one can persist every "xsd:any" element from a given XML-Schema
without registering it with an EPackage.

I will open a bugzilla. I hope this isn't hard, cause this is my first
one:)

Greetings

Daniel Gerlach
Previous Topic:Re: [Teneo] Hibernate xsd:any support / JPOX genereate MappingFile problem
Next Topic:error in initializing data store
Goto Forum:
  


Current Time: Wed Jul 28 06:28:50 GMT 2021

Powered by FUDForum. Page generated in 0.02723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top