Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] change ORM generation schema
[TEXO] change ORM generation schema [message #551185] Thu, 05 August 2010 10:31 Go to next message
Eclipse UserFriend
Hi,

I tried Texo using JPA and it worked well. I have seen the orm.xml refers to
xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm" version="2.1"

The JEE glassfish server creates an orm.xml that refers to:
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"

Can I change the schema in Texo?

I want to persist EMF model objects on an JEE server using JPA. For this I use TEXO and the ModelEMFConverter.
If I load an object from the database, I get an POJO which will be converted by the ModelEMFConverter, which returns a DynamicEObject.

Is there a way to convert the dynamic object into my model instance?

Last question. Is there any documentation, how to extend TEXO to generate for example wsdl, web.xml? Does it all work with xpand or do you use m2m transformation to generate the orm.xml?

Thanks for Texo!!

Regards,
Mark



Re: [TEXO] change ORM generation schema [message #551275 is a reply to message #551185] Thu, 05 August 2010 14:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mark,
See comments inline.

gr. Martin

On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
> Hi,
>
> I tried Texo using JPA and it worked well. I have seen the orm.xml
> refers to
> xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
> version="2.1"
>
> The JEE glassfish server creates an orm.xml that refers to:
> version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>
> Can I change the schema in Texo?
MT>> Hmm, not really.. I have had another request to support standard JPA/orm.xml instead of the EclipseLink specific
version. So I have thought about doing that.
But what do you mean with the 'jee glassfish server creates an orm.xml', you mean that the glassfish server expects that
the orm.xml should have this namespace?


>
> I want to persist EMF model objects on an JEE server using JPA. For this
> I use TEXO and the ModelEMFConverter.
> If I load an object from the database, I get an POJO which will be
> converted by the ModelEMFConverter, which returns a DynamicEObject.
>
> Is there a way to convert the dynamic object into my model instance?
MT>> the EMFModelConverter :-)
http://wiki.eclipse.org/Texo/Convert_to_EMF

>
> Last question. Is there any documentation, how to extend TEXO to
> generate for example wsdl, web.xml? Does it all work with xpand or do
> you use m2m transformation to generate the orm.xml?
MT>> Currently Texo is xpand based. See here for pointers on how to extend the code generation:
http://wiki.eclipse.org/Texo/Template_Overriding
Also specifically this part:
http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override

Btw, if you have specific ideas on a different override/extend mechanism then let me know!


>
> Thanks for Texo!!
MT>> yaw!
>
> Regards,
> Mark
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [TEXO] Bug in ModelEMFConverter ? [message #551348 is a reply to message #551275] Fri, 06 August 2010 01:58 Go to previous messageGo to next message
Eclipse UserFriend
Hi Martin,

regarding the Texo2EMF conversion.
I have found out that ModelEMFConverter works differently in OSGi and non OSGi environments. In an OSGi environment like an Eclipse plugin everything works as expected.

My problem is that I try to convert the Texo model object into my EMF object in an non OSGi environment (JEE/EJB3). I did exactly the same:

- I have a ecore describing a user and its address
- I generated the Texo model code (texo.User, texo.Address)
- I generated the ecore model code from the genmodel to transfer my emf.User instances to my RCP because of JPA dependency that are waved into JPA objects, so Texo POJO's too.
- Now I tried the ModelEMFConverter on the server, which work very well, but the return typ is a EObject (DynamicEObjectImpl) instead of an emf.UserImpl in OSGi
- Now I have to create a emf.User from the DynamicInstance.

Is this a bug?


I have installed the glassfish JEE server plugins for the web tools platform. This plugins generate an orm.xml with the:
version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd
"

reference.

The glassfish server uses eclipselink as jpa provider. I have tested the texo-generated orm.xml. It worked very well in an EJB3.1. I dont know, if other JEE servers like Geronimo with other persistence providers (OpenJPA, Hibernate) work with the eclipselink scheme reference in the orm.xml.


Currently I work on a RCP that is connected to a JEE server. For this I could imagine following feature to get a "tool-chain" using texo:
- create sql statements for tables, triggers from my model
- create jee-resources (usually xml files)
- create annotated EJB, EAR, WAR components from my ecore (stateless, stateful, message driven, timer, webservice, servlets, web.xml, application.xml)
- JPA already works Smile
- JAXB
- finally I would use Texo to create a osgi service facade that delegates service calls to the jee server in my RCP

All that could be generated from an ecore model. I already created an implementation of the last point using jet.
I am already a beginner with the EMF stuff and used ecore as application model in my RCP's.
I would provide some help, if needed, because Texo fits my future needs very well.

Regards,
Mark


Martin taal wrote on Thu, 05 August 2010 14:45
Hi Mark,
See comments inline.

gr. Martin

On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
> Hi,
>
> I tried Texo using JPA and it worked well. I have seen the orm.xml
> refers to
> xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
> version="2.1"
>
> The JEE glassfish server creates an orm.xml that refers to:
> version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>
> Can I change the schema in Texo?
MT>> Hmm, not really.. I have had another request to support standard JPA/orm.xml instead of the EclipseLink specific
version. So I have thought about doing that.
But what do you mean with the 'jee glassfish server creates an orm.xml', you mean that the glassfish server expects that
the orm.xml should have this namespace?


>
> I want to persist EMF model objects on an JEE server using JPA. For this
> I use TEXO and the ModelEMFConverter.
> If I load an object from the database, I get an POJO which will be
> converted by the ModelEMFConverter, which returns a DynamicEObject.
>
> Is there a way to convert the dynamic object into my model instance?
MT>> the EMFModelConverter Smile
http://wiki.eclipse.org/Texo/Convert_to_EMF

>
> Last question. Is there any documentation, how to extend TEXO to
> generate for example wsdl, web.xml? Does it all work with xpand or do
> you use m2m transformation to generate the orm.xml?
MT>> Currently Texo is xpand based. See here for pointers on how to extend the code generation:
http://wiki.eclipse.org/Texo/Template_Overriding
Also specifically this part:
http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override

Btw, if you have specific ideas on a different override/extend mechanism then let me know!


>
> Thanks for Texo!!
MT>> yaw!
>
> Regards,
> Mark
>
>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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

[Updated on: Fri, 06 August 2010 06:55] by Moderator

Re: [TEXO] change ORM generation schema [message #551434 is a reply to message #551348] Fri, 06 August 2010 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mark,
I am on holiday so a bit slower in my reaction, see comments inline.

gr. Martin

On 08/06/2010 07:58 AM, Mark Hoffmann wrote:
> Hi Martin,
>
> I have installed the glassfish JEE server plugins for the web tools
> platform. This plugins generate an orm.xml with the:
> version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.co m/xml/ns/persistence/orm_2_0.xsd"
>
> reference.
MT>> Ok, but if glassfish generates the orm then that's fine? I am not sure I understand the problem yet... do you want
Texo to generate the orm or the glassfish server?

>
> The glassfish server uses eclipselink as jpa provider. I have tested the
> texo-generated orm.xml. It worked very well in an EJB3.1. I dont know,
> if other JEE servers like Geronimo with other persistence providers
> (OpenJPA, Hibernate) work with the eclipselink scheme reference in the
> orm.xml.
>
> Because of the Texo to EMF conversion, I try to explain my question again:
> - I have a ecore describing a user and its address
> - I generated the Texo model code (texo.User, texo.Address)
> - I generated orm annotation using Texo
> I use the Texo model object and orm.xml on the jee server
> - I generated the ecore model code from the genmodel to use my User
> instances in my RCP (for databinding) (emf.User, emf.Address)
> Now I tried the ModelEMFConverter, which work very well, but the return
> typ is a EObject (DynamicEObjectImpl).
> So if I convert texo.User into EMF I get the DynamicEObjectImpl, but I
> want the emf.User.
>
> Now I need turn the DynamicEObject into emf.User instances. Can you tell
> me how I can achieve this?
MT>> The ModelEMFConverter does this:
eObject = (InternalEObject) EcoreUtil.create(eClass);
So if the eClass belongs to your generated EPackage then it should create an emf.User.

Note that you can tell Texo which EPackageRegistry to use:
ModelResolver.getInstance().setEPackageRegistry(Registry);

So if your generated EPackage is present in the registry used by Texo then it should create the emf.User.

Maybe you can debug into the ModelEMFConverter.createTarget method to see what happens.

>
>
> Currently I work on a RCP that is connected to a JEE server. For this I
> could imagine following feature to get a "tool-chain" using texo:
> - create sql statements for tables, triggers from my model
> - create jee-resources (usually xml files)
> - create annotated EJB, EAR, WAR components from my ecore (stateless,
> stateful, message driven, timer, webservice, servlets, web.xml,
> application.xml)
> - JPA already works :)
> - JAXB
MT>> You can also use EMF Texo here:
http://wiki.eclipse.org/Texo/XML_and_XMI_Serialization

I tried to generate jaxb annotations inside Texo also but I encountered too many issues in that Texo generated classes
do not fit well in what jaxb requires.

> - finally I would use Texo to create a osgi service facade that
> delegates service calls to the jee server in my RCP
>
> All that could be generated from an ecore model. I already created an
> implementation of the last point using jet.
> I am already a beginner with the EMF stuff and used ecore as application
> model in my RCP's.
> I would provide some help, if needed, because Texo fits my future needs
> very well.
MT>> yes please do so, I am very interested to extend Texo and feedback and other help is greatly appreciated. I am also
looking for people who want to work with me on this, so if you think that specific generation logic (for the wsdl for
example) could be provided as part of Texo then just let me know.
>
> Regards,
> Mark
>
>
> Martin taal wrote on Thu, 05 August 2010 14:45
>> Hi Mark,
>> See comments inline.
>>
>> gr. Martin
>>
>> On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
>> > Hi,
>> >
>> > I tried Texo using JPA and it worked well. I have seen the orm.xml
>> > refers to
>> > xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
>> > version="2.1"
>> >
>> > The JEE glassfish server creates an orm.xml that refers to:
>> > version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>> > http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>> >
>> > Can I change the schema in Texo?
>> MT>> Hmm, not really.. I have had another request to support standard
>> JPA/orm.xml instead of the EclipseLink specific version. So I have
>> thought about doing that.
>> But what do you mean with the 'jee glassfish server creates an
>> orm.xml', you mean that the glassfish server expects that the orm.xml
>> should have this namespace?
>>
>>
>> >
>> > I want to persist EMF model objects on an JEE server using JPA. For
>> this
>> > I use TEXO and the ModelEMFConverter.
>> > If I load an object from the database, I get an POJO which will be
>> > converted by the ModelEMFConverter, which returns a DynamicEObject.
>> >
>> > Is there a way to convert the dynamic object into my model instance?
>> MT>> the EMFModelConverter :)
>> http://wiki.eclipse.org/Texo/Convert_to_EMF
>>
>> >
>> > Last question. Is there any documentation, how to extend TEXO to
>> > generate for example wsdl, web.xml? Does it all work with xpand or do
>> > you use m2m transformation to generate the orm.xml?
>> MT>> Currently Texo is xpand based. See here for pointers on how to
>> extend the code generation:
>> http://wiki.eclipse.org/Texo/Template_Overriding
>> Also specifically this part:
>> http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override
>>
>> Btw, if you have specific ideas on a different override/extend
>> mechanism then let me know!
>>
>>
>> >
>> > Thanks for Texo!!
>> MT>> yaw!
>> >
>> > Regards,
>> > Mark
>> >
>> >
>> >
>> >
>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Cell: +31 (0)6 288 48 943
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [TEXO] change ORM generation schema [message #551435 is a reply to message #551348] Fri, 06 August 2010 08:26 Go to previous message
Eclipse UserFriend
Hi Mark,
I am on holiday so a bit slower in my reaction, see comments inline.

gr. Martin

On 08/06/2010 07:58 AM, Mark Hoffmann wrote:
> Hi Martin,
>
> I have installed the glassfish JEE server plugins for the web tools
> platform. This plugins generate an orm.xml with the:
> version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.co m/xml/ns/persistence/orm_2_0.xsd"
>
> reference.
MT>> Ok, but if glassfish generates the orm then that's fine? I am not sure I understand the problem yet... do you want
Texo to generate the orm or the glassfish server?

>
> The glassfish server uses eclipselink as jpa provider. I have tested the
> texo-generated orm.xml. It worked very well in an EJB3.1. I dont know,
> if other JEE servers like Geronimo with other persistence providers
> (OpenJPA, Hibernate) work with the eclipselink scheme reference in the
> orm.xml.
>
> Because of the Texo to EMF conversion, I try to explain my question again:
> - I have a ecore describing a user and its address
> - I generated the Texo model code (texo.User, texo.Address)
> - I generated orm annotation using Texo
> I use the Texo model object and orm.xml on the jee server
> - I generated the ecore model code from the genmodel to use my User
> instances in my RCP (for databinding) (emf.User, emf.Address)
> Now I tried the ModelEMFConverter, which work very well, but the return
> typ is a EObject (DynamicEObjectImpl).
> So if I convert texo.User into EMF I get the DynamicEObjectImpl, but I
> want the emf.User.
>
> Now I need turn the DynamicEObject into emf.User instances. Can you tell
> me how I can achieve this?
MT>> The ModelEMFConverter does this:
eObject = (InternalEObject) EcoreUtil.create(eClass);
So if the eClass belongs to your generated EPackage then it should create an emf.User.

Note that you can tell Texo which EPackageRegistry to use:
ModelResolver.getInstance().setEPackageRegistry(Registry);

So if your generated EPackage is present in the registry used by Texo then it should create the emf.User.

Maybe you can debug into the ModelEMFConverter.createTarget method to see what happens.

>
>
> Currently I work on a RCP that is connected to a JEE server. For this I
> could imagine following feature to get a "tool-chain" using texo:
> - create sql statements for tables, triggers from my model
> - create jee-resources (usually xml files)
> - create annotated EJB, EAR, WAR components from my ecore (stateless,
> stateful, message driven, timer, webservice, servlets, web.xml,
> application.xml)
> - JPA already works :)
> - JAXB
MT>> You can also use EMF Texo here:
http://wiki.eclipse.org/Texo/XML_and_XMI_Serialization

I tried to generate jaxb annotations inside Texo also but I encountered too many issues in that Texo generated classes
do not fit well in what jaxb requires.

> - finally I would use Texo to create a osgi service facade that
> delegates service calls to the jee server in my RCP
>
> All that could be generated from an ecore model. I already created an
> implementation of the last point using jet.
> I am already a beginner with the EMF stuff and used ecore as application
> model in my RCP's.
> I would provide some help, if needed, because Texo fits my future needs
> very well.
MT>> yes please do so, I am very interested to extend Texo and feedback and other help is greatly appreciated. I am also
looking for people who want to work with me on this, so if you think that specific generation logic (for the wsdl for
example) could be provided as part of Texo then just let me know.
>
> Regards,
> Mark
>
>
> Martin taal wrote on Thu, 05 August 2010 14:45
>> Hi Mark,
>> See comments inline.
>>
>> gr. Martin
>>
>> On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
>> > Hi,
>> >
>> > I tried Texo using JPA and it worked well. I have seen the orm.xml
>> > refers to
>> > xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
>> > version="2.1"
>> >
>> > The JEE glassfish server creates an orm.xml that refers to:
>> > version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>> > http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>> >
>> > Can I change the schema in Texo?
>> MT>> Hmm, not really.. I have had another request to support standard
>> JPA/orm.xml instead of the EclipseLink specific version. So I have
>> thought about doing that.
>> But what do you mean with the 'jee glassfish server creates an
>> orm.xml', you mean that the glassfish server expects that the orm.xml
>> should have this namespace?
>>
>>
>> >
>> > I want to persist EMF model objects on an JEE server using JPA. For
>> this
>> > I use TEXO and the ModelEMFConverter.
>> > If I load an object from the database, I get an POJO which will be
>> > converted by the ModelEMFConverter, which returns a DynamicEObject.
>> >
>> > Is there a way to convert the dynamic object into my model instance?
>> MT>> the EMFModelConverter :)
>> http://wiki.eclipse.org/Texo/Convert_to_EMF
>>
>> >
>> > Last question. Is there any documentation, how to extend TEXO to
>> > generate for example wsdl, web.xml? Does it all work with xpand or do
>> > you use m2m transformation to generate the orm.xml?
>> MT>> Currently Texo is xpand based. See here for pointers on how to
>> extend the code generation:
>> http://wiki.eclipse.org/Texo/Template_Overriding
>> Also specifically this part:
>> http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override
>>
>> Btw, if you have specific ideas on a different override/extend
>> mechanism then let me know!
>>
>>
>> >
>> > Thanks for Texo!!
>> MT>> yaw!
>> >
>> > Regards,
>> > Mark
>> >
>> >
>> >
>> >
>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Cell: +31 (0)6 288 48 943
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [TEXO] change ORM generation schema [message #623120 is a reply to message #551275] Fri, 06 August 2010 01:58 Go to previous message
Eclipse UserFriend
Hi Martin,

I have installed the glassfish JEE server plugins for the web tools platform. This plugins generate an orm.xml with the:
version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.co m/xml/ns/persistence/orm_2_0.xsd"

reference.

The glassfish server uses eclipselink as jpa provider. I have tested the texo-generated orm.xml. It worked very well in an EJB3.1. I dont know, if other JEE servers like Geronimo with other persistence providers (OpenJPA, Hibernate) work with the eclipselink scheme reference in the orm.xml.

Because of the Texo to EMF conversion, I try to explain my question again:
- I have a ecore describing a user and its address
- I generated the Texo model code (texo.User, texo.Address)
- I generated orm annotation using Texo
I use the Texo model object and orm.xml on the jee server
- I generated the ecore model code from the genmodel to use my User instances in my RCP (for databinding) (emf.User, emf.Address)
Now I tried the ModelEMFConverter, which work very well, but the return typ is a EObject (DynamicEObjectImpl).
So if I convert texo.User into EMF I get the DynamicEObjectImpl, but I want the emf.User.

Now I need turn the DynamicEObject into emf.User instances. Can you tell me how I can achieve this?


Currently I work on a RCP that is connected to a JEE server. For this I could imagine following feature to get a "tool-chain" using texo:
- create sql statements for tables, triggers from my model
- create jee-resources (usually xml files)
- create annotated EJB, EAR, WAR components from my ecore (stateless, stateful, message driven, timer, webservice, servlets, web.xml, application.xml)
- JPA already works :)
- JAXB
- finally I would use Texo to create a osgi service facade that delegates service calls to the jee server in my RCP

All that could be generated from an ecore model. I already created an implementation of the last point using jet.
I am already a beginner with the EMF stuff and used ecore as application model in my RCP's.
I would provide some help, if needed, because Texo fits my future needs very well.

Regards,
Mark


Martin taal wrote on Thu, 05 August 2010 14:45
> Hi Mark,
> See comments inline.
>
> gr. Martin
>
> On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
> > Hi,
> >
> > I tried Texo using JPA and it worked well. I have seen the orm.xml
> > refers to
> > xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
> > version="2.1"
> >
> > The JEE glassfish server creates an orm.xml that refers to:
> > version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> > http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
> >
> > Can I change the schema in Texo?
> MT>> Hmm, not really.. I have had another request to support standard JPA/orm.xml instead of the EclipseLink specific
> version. So I have thought about doing that.
> But what do you mean with the 'jee glassfish server creates an orm.xml', you mean that the glassfish server expects that
> the orm.xml should have this namespace?
>
>
> >
> > I want to persist EMF model objects on an JEE server using JPA. For this
> > I use TEXO and the ModelEMFConverter.
> > If I load an object from the database, I get an POJO which will be
> > converted by the ModelEMFConverter, which returns a DynamicEObject.
> >
> > Is there a way to convert the dynamic object into my model instance?
> MT>> the EMFModelConverter :)
> http://wiki.eclipse.org/Texo/Convert_to_EMF
>
> >
> > Last question. Is there any documentation, how to extend TEXO to
> > generate for example wsdl, web.xml? Does it all work with xpand or do
> > you use m2m transformation to generate the orm.xml?
> MT>> Currently Texo is xpand based. See here for pointers on how to extend the code generation:
> http://wiki.eclipse.org/Texo/Template_Overriding
> Also specifically this part:
> http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override
>
> Btw, if you have specific ideas on a different override/extend mechanism then let me know!
>
>
> >
> > Thanks for Texo!!
> MT>> yaw!
> >
> > Regards,
> > Mark
> >
> >
> >
> >
>
>
> --
>
> With Regards, Martin Taal
>
> Springsite/Elver.org
> Office: Hardwareweg 4, 3821 BV Amersfoort
> Postal: Nassaulaan 7, 3941 EC Doorn
> The Netherlands
> Cell: +31 (0)6 288 48 943
> 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: [TEXO] change ORM generation schema [message #623122 is a reply to message #623120] Fri, 06 August 2010 08:26 Go to previous message
Eclipse UserFriend
Hi Mark,
I am on holiday so a bit slower in my reaction, see comments inline.

gr. Martin

On 08/06/2010 07:58 AM, Mark Hoffmann wrote:
> Hi Martin,
>
> I have installed the glassfish JEE server plugins for the web tools
> platform. This plugins generate an orm.xml with the:
> version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.co m/xml/ns/persistence/orm_2_0.xsd"
>
> reference.
MT>> Ok, but if glassfish generates the orm then that's fine? I am not sure I understand the problem yet... do you want
Texo to generate the orm or the glassfish server?

>
> The glassfish server uses eclipselink as jpa provider. I have tested the
> texo-generated orm.xml. It worked very well in an EJB3.1. I dont know,
> if other JEE servers like Geronimo with other persistence providers
> (OpenJPA, Hibernate) work with the eclipselink scheme reference in the
> orm.xml.
>
> Because of the Texo to EMF conversion, I try to explain my question again:
> - I have a ecore describing a user and its address
> - I generated the Texo model code (texo.User, texo.Address)
> - I generated orm annotation using Texo
> I use the Texo model object and orm.xml on the jee server
> - I generated the ecore model code from the genmodel to use my User
> instances in my RCP (for databinding) (emf.User, emf.Address)
> Now I tried the ModelEMFConverter, which work very well, but the return
> typ is a EObject (DynamicEObjectImpl).
> So if I convert texo.User into EMF I get the DynamicEObjectImpl, but I
> want the emf.User.
>
> Now I need turn the DynamicEObject into emf.User instances. Can you tell
> me how I can achieve this?
MT>> The ModelEMFConverter does this:
eObject = (InternalEObject) EcoreUtil.create(eClass);
So if the eClass belongs to your generated EPackage then it should create an emf.User.

Note that you can tell Texo which EPackageRegistry to use:
ModelResolver.getInstance().setEPackageRegistry(Registry);

So if your generated EPackage is present in the registry used by Texo then it should create the emf.User.

Maybe you can debug into the ModelEMFConverter.createTarget method to see what happens.

>
>
> Currently I work on a RCP that is connected to a JEE server. For this I
> could imagine following feature to get a "tool-chain" using texo:
> - create sql statements for tables, triggers from my model
> - create jee-resources (usually xml files)
> - create annotated EJB, EAR, WAR components from my ecore (stateless,
> stateful, message driven, timer, webservice, servlets, web.xml,
> application.xml)
> - JPA already works :)
> - JAXB
MT>> You can also use EMF Texo here:
http://wiki.eclipse.org/Texo/XML_and_XMI_Serialization

I tried to generate jaxb annotations inside Texo also but I encountered too many issues in that Texo generated classes
do not fit well in what jaxb requires.

> - finally I would use Texo to create a osgi service facade that
> delegates service calls to the jee server in my RCP
>
> All that could be generated from an ecore model. I already created an
> implementation of the last point using jet.
> I am already a beginner with the EMF stuff and used ecore as application
> model in my RCP's.
> I would provide some help, if needed, because Texo fits my future needs
> very well.
MT>> yes please do so, I am very interested to extend Texo and feedback and other help is greatly appreciated. I am also
looking for people who want to work with me on this, so if you think that specific generation logic (for the wsdl for
example) could be provided as part of Texo then just let me know.
>
> Regards,
> Mark
>
>
> Martin taal wrote on Thu, 05 August 2010 14:45
>> Hi Mark,
>> See comments inline.
>>
>> gr. Martin
>>
>> On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
>> > Hi,
>> >
>> > I tried Texo using JPA and it worked well. I have seen the orm.xml
>> > refers to
>> > xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
>> > version="2.1"
>> >
>> > The JEE glassfish server creates an orm.xml that refers to:
>> > version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>> > http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>> >
>> > Can I change the schema in Texo?
>> MT>> Hmm, not really.. I have had another request to support standard
>> JPA/orm.xml instead of the EclipseLink specific version. So I have
>> thought about doing that.
>> But what do you mean with the 'jee glassfish server creates an
>> orm.xml', you mean that the glassfish server expects that the orm.xml
>> should have this namespace?
>>
>>
>> >
>> > I want to persist EMF model objects on an JEE server using JPA. For
>> this
>> > I use TEXO and the ModelEMFConverter.
>> > If I load an object from the database, I get an POJO which will be
>> > converted by the ModelEMFConverter, which returns a DynamicEObject.
>> >
>> > Is there a way to convert the dynamic object into my model instance?
>> MT>> the EMFModelConverter :)
>> http://wiki.eclipse.org/Texo/Convert_to_EMF
>>
>> >
>> > Last question. Is there any documentation, how to extend TEXO to
>> > generate for example wsdl, web.xml? Does it all work with xpand or do
>> > you use m2m transformation to generate the orm.xml?
>> MT>> Currently Texo is xpand based. See here for pointers on how to
>> extend the code generation:
>> http://wiki.eclipse.org/Texo/Template_Overriding
>> Also specifically this part:
>> http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override
>>
>> Btw, if you have specific ideas on a different override/extend
>> mechanism then let me know!
>>
>>
>> >
>> > Thanks for Texo!!
>> MT>> yaw!
>> >
>> > Regards,
>> > Mark
>> >
>> >
>> >
>> >
>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Cell: +31 (0)6 288 48 943
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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: [TEXO] change ORM generation schema [message #623123 is a reply to message #623120] Fri, 06 August 2010 08:26 Go to previous message
Eclipse UserFriend
Hi Mark,
I am on holiday so a bit slower in my reaction, see comments inline.

gr. Martin

On 08/06/2010 07:58 AM, Mark Hoffmann wrote:
> Hi Martin,
>
> I have installed the glassfish JEE server plugins for the web tools
> platform. This plugins generate an orm.xml with the:
> version="2.0" xmlns="[url]http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence/ormhttp://java.sun.co m/xml/ns/persistence/orm_2_0.xsd"
>
> reference.
MT>> Ok, but if glassfish generates the orm then that's fine? I am not sure I understand the problem yet... do you want
Texo to generate the orm or the glassfish server?

>
> The glassfish server uses eclipselink as jpa provider. I have tested the
> texo-generated orm.xml. It worked very well in an EJB3.1. I dont know,
> if other JEE servers like Geronimo with other persistence providers
> (OpenJPA, Hibernate) work with the eclipselink scheme reference in the
> orm.xml.
>
> Because of the Texo to EMF conversion, I try to explain my question again:
> - I have a ecore describing a user and its address
> - I generated the Texo model code (texo.User, texo.Address)
> - I generated orm annotation using Texo
> I use the Texo model object and orm.xml on the jee server
> - I generated the ecore model code from the genmodel to use my User
> instances in my RCP (for databinding) (emf.User, emf.Address)
> Now I tried the ModelEMFConverter, which work very well, but the return
> typ is a EObject (DynamicEObjectImpl).
> So if I convert texo.User into EMF I get the DynamicEObjectImpl, but I
> want the emf.User.
>
> Now I need turn the DynamicEObject into emf.User instances. Can you tell
> me how I can achieve this?
MT>> The ModelEMFConverter does this:
eObject = (InternalEObject) EcoreUtil.create(eClass);
So if the eClass belongs to your generated EPackage then it should create an emf.User.

Note that you can tell Texo which EPackageRegistry to use:
ModelResolver.getInstance().setEPackageRegistry(Registry);

So if your generated EPackage is present in the registry used by Texo then it should create the emf.User.

Maybe you can debug into the ModelEMFConverter.createTarget method to see what happens.

>
>
> Currently I work on a RCP that is connected to a JEE server. For this I
> could imagine following feature to get a "tool-chain" using texo:
> - create sql statements for tables, triggers from my model
> - create jee-resources (usually xml files)
> - create annotated EJB, EAR, WAR components from my ecore (stateless,
> stateful, message driven, timer, webservice, servlets, web.xml,
> application.xml)
> - JPA already works :)
> - JAXB
MT>> You can also use EMF Texo here:
http://wiki.eclipse.org/Texo/XML_and_XMI_Serialization

I tried to generate jaxb annotations inside Texo also but I encountered too many issues in that Texo generated classes
do not fit well in what jaxb requires.

> - finally I would use Texo to create a osgi service facade that
> delegates service calls to the jee server in my RCP
>
> All that could be generated from an ecore model. I already created an
> implementation of the last point using jet.
> I am already a beginner with the EMF stuff and used ecore as application
> model in my RCP's.
> I would provide some help, if needed, because Texo fits my future needs
> very well.
MT>> yes please do so, I am very interested to extend Texo and feedback and other help is greatly appreciated. I am also
looking for people who want to work with me on this, so if you think that specific generation logic (for the wsdl for
example) could be provided as part of Texo then just let me know.
>
> Regards,
> Mark
>
>
> Martin taal wrote on Thu, 05 August 2010 14:45
>> Hi Mark,
>> See comments inline.
>>
>> gr. Martin
>>
>> On 08/05/2010 04:31 PM, Mark Hoffmann wrote:
>> > Hi,
>> >
>> > I tried Texo using JPA and it worked well. I have seen the orm.xml
>> > refers to
>> > xmlns:orm="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
>> > version="2.1"
>> >
>> > The JEE glassfish server creates an orm.xml that refers to:
>> > version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
>> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> > xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
>> > http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
>> >
>> > Can I change the schema in Texo?
>> MT>> Hmm, not really.. I have had another request to support standard
>> JPA/orm.xml instead of the EclipseLink specific version. So I have
>> thought about doing that.
>> But what do you mean with the 'jee glassfish server creates an
>> orm.xml', you mean that the glassfish server expects that the orm.xml
>> should have this namespace?
>>
>>
>> >
>> > I want to persist EMF model objects on an JEE server using JPA. For
>> this
>> > I use TEXO and the ModelEMFConverter.
>> > If I load an object from the database, I get an POJO which will be
>> > converted by the ModelEMFConverter, which returns a DynamicEObject.
>> >
>> > Is there a way to convert the dynamic object into my model instance?
>> MT>> the EMFModelConverter :)
>> http://wiki.eclipse.org/Texo/Convert_to_EMF
>>
>> >
>> > Last question. Is there any documentation, how to extend TEXO to
>> > generate for example wsdl, web.xml? Does it all work with xpand or do
>> > you use m2m transformation to generate the orm.xml?
>> MT>> Currently Texo is xpand based. See here for pointers on how to
>> extend the code generation:
>> http://wiki.eclipse.org/Texo/Template_Overriding
>> Also specifically this part:
>> http://wiki.eclipse.org/Texo/Template_Overriding#Templates_t o_override
>>
>> Btw, if you have specific ideas on a different override/extend
>> mechanism then let me know!
>>
>>
>> >
>> > Thanks for Texo!!
>> MT>> yaw!
>> >
>> > Regards,
>> > Mark
>> >
>> >
>> >
>> >
>>
>>
>> --
>>
>> With Regards, Martin Taal
>>
>> Springsite/Elver.org
>> Office: Hardwareweg 4, 3821 BV Amersfoort
>> Postal: Nassaulaan 7, 3941 EC Doorn
>> The Netherlands
>> Cell: +31 (0)6 288 48 943
>> 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
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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
Previous Topic:Provide ResourceSet to ecore editor
Next Topic:[TEXO] overriding templates question
Goto Forum:
  


Current Time: Fri Nov 14 21:46:07 EST 2025

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

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

Back to the top