Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF EList & Database (Hibernate) loading problem
EMF EList & Database (Hibernate) loading problem [message #1037977] Wed, 10 April 2013 04:41 Go to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 328
Registered: July 2009
Senior Member
hello!

i got the following problem:
i got an reference on my EClass A with 0..* elements from EClass B

my problem is that hibernate needs a setter for this reference.
therefore i implemented a setter, which uses the getter to add stuff like

public void setList(List newList) {
getList().clear();
getList().addAll(newList);
}


whenever i do this, hibernate resolves the results (though setting as LAZY) due the newList.size() command.

i doubt that i am the first one with this problem.
i need the returned list to be an EList, but hibernate cant do so and returns me a simple List. so how can i transform my list into an EList without touching the size()???

can Texo solve this for me?

thanks in advance
ludwig
Re: EMF EList & Database (Hibernate) loading problem [message #1038014 is a reply to message #1037977] Wed, 10 April 2013 05:36 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Ludwig,
Yes that's why you need Teneo or Texo to combine EMF concepts with Hibernate/EclipseLink.

You can use Teneo if you want to have a 2-tier architecture with a RCP talking directly to a database.
In other cases (3-tier or web-service environments) I would use Texo.

gr. Martin

On 04/10/2013 10:41 AM, Ludwig Moser wrote:
> hello!
>
> i got the following problem:
> i got an reference on my EClass A with 0..* elements from EClass B
>
> my problem is that hibernate needs a setter for this reference.
> therefore i implemented a setter, which uses the getter to add stuff like
>
> public void setList(List newList) {
> getList().clear();
> getList().addAll(newList);
> }
>
> whenever i do this, hibernate resolves the results (though setting as LAZY) due the newList.size() command.
>
> i doubt that i am the first one with this problem.
> i need the returned list to be an EList, but hibernate cant do so and returns me a simple List. so how can i transform
> my list into an EList without touching the size()???
>
> can Texo solve this for me?
>
> thanks in advance
> ludwig


--

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: EMF EList & Database (Hibernate) loading problem [message #1038043 is a reply to message #1038014] Wed, 10 April 2013 06:28 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig Moser
Messages: 328
Registered: July 2009
Senior Member
i know about teneo and texo,
we did the texo rcp example together
but to be true i cant remember why teneo or why texo (RCP)

in my case an rcp app talks to an database server (can be located on the same machine or on a server - LAN or Internet)
our texo example is working with an xml resource if i remember right.
sorry for confusion, but i just dont know which one i shall pick (as on one hand teneo is for rcp, on the other hand i wrote the texo rcp example with you)
thanks in advance
Re: EMF EList & Database (Hibernate) loading problem [message #1038076 is a reply to message #1038043] Wed, 10 April 2013 07:19 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5329
Registered: July 2009
Senior Member
Hi Ludwig,
Yes! You can use both Texo or Teneo it is up to you. I think Texo is better from an architecture point of view as it
does not rely on detailed internals of hibernate, with Texo you can use EclipseLink also. Texo also has EMF resource
implementation one for a 2 tier approach, the other for a 3-tier approach.
But with Texo you need to generate 2 code bases: EMF EObjects and Texo objects. That's the disadvantage, for Teneo this
is not needed.
So for simplicity in a 2-tier RCP I would use Teneo for now.

gr. Martin

On 04/10/2013 12:28 PM, Ludwig Moser wrote:
> i know about teneo and texo,
> we did the texo rcp example together
> but to be true i cant remember why teneo or why texo (RCP)
>
> in my case an rcp app talks to an database server (can be located on the same machine or on a server - LAN or Internet)
> our texo example is working with an xml resource if i remember right.
> sorry for confusion, but i just dont know which one i shall pick (as on one hand teneo is for rcp, on the other hand i
> wrote the texo rcp example with you)
> thanks in advance


--

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
Previous Topic:[TENEO] Support for Dynamic-Update Attribute
Next Topic:[CDO] Failover / DBUtil.deserializeTable - Out of Memory
Goto Forum:
  


Current Time: Thu Aug 28 11:24:01 EDT 2014

Powered by FUDForum. Page generated in 0.01843 seconds