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  |
Martin Taal 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 #112494 is a reply to message #112482] |
Sun, 17 February 2008 13:39   |
Martin Taal 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 #615504 is a reply to message #112482] |
Sun, 17 February 2008 13:39  |
Martin Taal 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
|
|
| |
Goto Forum:
Current Time: Tue Jun 06 11:05:09 GMT 2023
Powered by FUDForum. Page generated in 0.02569 seconds
|