Home » Modeling » EMF » Design application with EMF and EclipseLink
Design application with EMF and EclipseLink [message #1228426] |
Tue, 07 January 2014 07:55 |
|
Hey all,
I have a design / best practise question concerning the usage of Eclipse Link and EMF.
I want to use Eclipse Link as ORM Tool and Eclipse EMF for modeling my objects and display them in my client. So i have to "transform" my EMF objects to my Eclipse-Link-Annotated pojos if i want to store them in my db.
This approach seems a little bit strange to me (and error-prone e.g. thinking of db-locking mechanisms), but i´m not sure if there is a better solution. I found the "Texo" framework which maybe could help me, but maybe there is another solution ? Are there any other good solutions / architectures / designs which solve my problem in an elegant way?
Thanks for any help / advice / discussion
Thomas
|
|
|
Re: Design application with EMF and EclipseLink [message #1228431 is a reply to message #1228426] |
Tue, 07 January 2014 08:12 |
|
Hi Thomas,
I don't know much about Eclipse Link but you also asked about other EMF / DB mapping solutions. The CDO Model Repository
typically uses an ORM on the server side and offers nice APIs for things like collaboration, transactionality or
querying on the client side.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 07.01.2014 08:55, schrieb Thomas Wilhelm:
> Hey all,
>
> I have a design / best practise question concerning the usage of Eclipse Link and EMF.
> I want to use Eclipse Link as ORM Tool and Eclipse EMF for modeling my objects and display them in my client. So i
> have to "transform" my EMF objects to my Eclipse-Link-Annotated pojos if i want to store them in my db.
> This approach seems a little bit strange to me (and error-prone e.g. thinking of db-locking mechanisms), but i´m not
> sure if there is a better solution. I found the "Texo" framework which maybe could help me, but maybe there is another
> solution ? Are there any other good solutions / architectures / designs which solve my problem in an elegant way?
>
> Thanks for any help / advice / discussion
> Thomas
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: Design application with EMF and EclipseLink [message #1228434 is a reply to message #1228431] |
Tue, 07 January 2014 08:24 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Thomas,
I think the Texo project indeed seems to be what you are looking for. It supports generating annotated JPA
pojos/entities and provides converters from EMF to the eclipselink pojos (and back). Texo generates/provides
out-of-the-box-zero-coding json/xml CRUD webservices for your model and an EMF resource implementation (also working
remotely), making it possible to use EMF on the RCP side and eclipselink on the ORM/server side.
The wiki (http://wiki.eclipse.org/Texo) and my blog provide/give some examples, see this one for example:
http://martintaal.wordpress.com/2012/08/30/taking-emf-to-the-third-tier-the-texo-json-resource/
As a side note, I am currently working on integrating xcore and Texo.
gr. Martin
On 01/07/2014 09:12 AM, Eike Stepper wrote:
> Hi Thomas,
>
> I don't know much about Eclipse Link but you also asked about other EMF / DB mapping solutions. The CDO Model Repository
> typically uses an ORM on the server side and offers nice APIs for things like collaboration, transactionality or
> querying on the client side.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 07.01.2014 08:55, schrieb Thomas Wilhelm:
>> Hey all,
>>
>> I have a design / best practise question concerning the usage of Eclipse Link and EMF.
>> I want to use Eclipse Link as ORM Tool and Eclipse EMF for modeling my objects and display them in my client. So i
>> have to "transform" my EMF objects to my Eclipse-Link-Annotated pojos if i want to store them in my db.
>> This approach seems a little bit strange to me (and error-prone e.g. thinking of db-locking mechanisms), but i´m not
>> sure if there is a better solution. I found the "Texo" framework which maybe could help me, but maybe there is another
>> solution ? Are there any other good solutions / architectures / designs which solve my problem in an elegant way?
>>
>> Thanks for any help / advice / discussion
>> Thomas
>
--
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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: Design application with EMF and EclipseLink [message #1228554 is a reply to message #1228434] |
Tue, 07 January 2014 13:49 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
On 07-01-14 09:24, Martin Taal wrote:
> Hi Thomas,
> I think the Texo project indeed seems to be what you are looking for.
Hi Martin,
In the past I used Teneo (With Hibernate), is this renamed to Texo?
Cheers Christophe
It
> supports generating annotated JPA pojos/entities and provides converters
> from EMF to the eclipselink pojos (and back). Texo generates/provides
> out-of-the-box-zero-coding json/xml CRUD webservices for your model and
> an EMF resource implementation (also working remotely), making it
> possible to use EMF on the RCP side and eclipselink on the ORM/server side.
>
> The wiki (http://wiki.eclipse.org/Texo) and my blog provide/give some
> examples, see this one for example:
> http://martintaal.wordpress.com/2012/08/30/taking-emf-to-the-third-tier-the-texo-json-resource/
>
>
> As a side note, I am currently working on integrating xcore and Texo.
>
> gr. Martin
>
> On 01/07/2014 09:12 AM, Eike Stepper wrote:
>> Hi Thomas,
>>
>> I don't know much about Eclipse Link but you also asked about other
>> EMF / DB mapping solutions. The CDO Model Repository
>> typically uses an ORM on the server side and offers nice APIs for
>> things like collaboration, transactionality or
>> querying on the client side.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 07.01.2014 08:55, schrieb Thomas Wilhelm:
>>> Hey all,
>>>
>>> I have a design / best practise question concerning the usage of
>>> Eclipse Link and EMF.
>>> I want to use Eclipse Link as ORM Tool and Eclipse EMF for modeling
>>> my objects and display them in my client. So i
>>> have to "transform" my EMF objects to my Eclipse-Link-Annotated pojos
>>> if i want to store them in my db.
>>> This approach seems a little bit strange to me (and error-prone e.g.
>>> thinking of db-locking mechanisms), but i´m not
>>> sure if there is a better solution. I found the "Texo" framework
>>> which maybe could help me, but maybe there is another
>>> solution ? Are there any other good solutions / architectures /
>>> designs which solve my problem in an elegant way?
>>>
>>> Thanks for any help / advice / discussion
>>> Thomas
>>
>
>
|
|
|
Re: Design application with EMF and EclipseLink [message #1228570 is a reply to message #1228554] |
Tue, 07 January 2014 14:06 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Christophe,
No, Texo is something completely new/other, Teneo did have an EclipseLink integration before, but it is no longer supported.
Texo uses EclipseLink for its testing (during the build), using generated pojos/entities.
gr. Martin
On 01/07/2014 02:49 PM, Christophe Bouhier wrote:
> On 07-01-14 09:24, Martin Taal wrote:
>> Hi Thomas,
>> I think the Texo project indeed seems to be what you are looking for.
> Hi Martin,
> In the past I used Teneo (With Hibernate), is this renamed to Texo?
> Cheers Christophe
>
>
> It
>> supports generating annotated JPA pojos/entities and provides converters
>> from EMF to the eclipselink pojos (and back). Texo generates/provides
>> out-of-the-box-zero-coding json/xml CRUD webservices for your model and
>> an EMF resource implementation (also working remotely), making it
>> possible to use EMF on the RCP side and eclipselink on the ORM/server side.
>>
>> The wiki (http://wiki.eclipse.org/Texo) and my blog provide/give some
>> examples, see this one for example:
>> http://martintaal.wordpress.com/2012/08/30/taking-emf-to-the-third-tier-the-texo-json-resource/
>>
>>
>> As a side note, I am currently working on integrating xcore and Texo.
>>
>> gr. Martin
>>
>> On 01/07/2014 09:12 AM, Eike Stepper wrote:
>>> Hi Thomas,
>>>
>>> I don't know much about Eclipse Link but you also asked about other
>>> EMF / DB mapping solutions. The CDO Model Repository
>>> typically uses an ORM on the server side and offers nice APIs for
>>> things like collaboration, transactionality or
>>> querying on the client side.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 07.01.2014 08:55, schrieb Thomas Wilhelm:
>>>> Hey all,
>>>>
>>>> I have a design / best practise question concerning the usage of
>>>> Eclipse Link and EMF.
>>>> I want to use Eclipse Link as ORM Tool and Eclipse EMF for modeling
>>>> my objects and display them in my client. So i
>>>> have to "transform" my EMF objects to my Eclipse-Link-Annotated pojos
>>>> if i want to store them in my db.
>>>> This approach seems a little bit strange to me (and error-prone e.g.
>>>> thinking of db-locking mechanisms), but i´m not
>>>> sure if there is a better solution. I found the "Texo" framework
>>>> which maybe could help me, but maybe there is another
>>>> solution ? Are there any other good solutions / architectures /
>>>> designs which solve my problem in an elegant way?
>>>>
>>>> Thanks for any help / advice / discussion
>>>> Thomas
>>>
>>
>>
>
--
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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Re: Design application with EMF and EclipseLink [message #1228847 is a reply to message #1228434] |
Wed, 08 January 2014 07:44 |
|
Hi Martin,
First of all thanks for your reply. I had a look at Texo but i don´t really know how what to do with it.
I can generate JPA-annotated Pojos and if i get it right, these pojos are also integrated in the EMF world via the Modelpackage class which is contributed to the extension point "org.eclipse.emf.ecore.generated_package".
But the pojo is not extended from EObject, so i loose the ability to get the Metadata (EClass information) which is quite important for me and one of the main reasons i use EMF (among the fact that EMF is simply cool ).
So can i create the pojos with EMF and then create a XML Mapping (orm.xml) with texo to be able to store my pojos via the EntityManager of EclipseLink?
Hopefully that was not too confusing
Thanks alot + Greetz
Thomas
|
|
|
Re: Design application with EMF and EclipseLink [message #1228869 is a reply to message #1228847] |
Wed, 08 January 2014 08:36 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Thomas,
Yes runtime model access is very important! Texo also allows you to get to the metadata quite easily. It is being used
all the time by Texo itself also in json/xml/emf conversions:
http://wiki.eclipse.org/Texo/Runtime_Model
and then specifically this part:
http://wiki.eclipse.org/Texo/Runtime_Model#Model-driven_access_to_Pojo.27s
You can not directly generate pojo's from EMF, EMF has specific list implementations which make it difficult/not
possible to persist directly in ORM's. Therefore there is the Texo project. Also the Teneo project can be of interest,
but it is based on Hibernate and can not run with EclipseLink.
gr. Martin
On 01/08/2014 08:44 AM, Thomas Wilhelm wrote:
> Hi Martin,
>
> First of all thanks for your reply. I had a look at Texo but i don´t really know how what to do with it. I can generate
> JPA-annotated Pojos and if i get it right, these pojos are also integrated in the EMF world via the Modelpackage class
> which is contributed to the extension point "org.eclipse.emf.ecore.generated_package". But the pojo is not extended from
> EObject, so i loose the ability to get the Metadata (EClass information) which is quite important for me and one of the
> main reasons i use EMF (among the fact that EMF is simply cool ;)).
> So can i create the pojos with EMF and then create a XML Mapping (orm.xml) with texo to be able to store my pojos via
> the EntityManager of EclipseLink?
> Hopefully that was not too confusing ;)
> Thanks alot + Greetz
> Thomas
--
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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
| |
Re: Design application with EMF and EclipseLink [message #1229044 is a reply to message #1228940] |
Wed, 08 January 2014 15:41 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Thomas,
Annotations like these are done in a so-called annotation model:
http://wiki.eclipse.org/Texo/ORM_JPA_Annotations_Details
I attached an example of this, you can let your types extend the Identifiable type in the attached ecore. To get a feel
for what I use for Texo testcases and such.
gr. Martin
On 01/08/2014 12:42 PM, Thomas Wilhelm wrote:
> Hi Martin,
> thanx again, i made an example project and it worked ;) One last question (for the moment ;)) i have:
> I added this annotation to my id attribute by myself, because i could not find how to generate it automatically:
>
> @Id
> @GeneratedValue( strategy = GenerationType.AUTO )
>
> How can i do that?
> Thanks again ;)
>
> Thomas
--
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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Sun Sep 22 23:42:14 GMT 2024
Powered by FUDForum. Page generated in 0.04630 seconds
|