Home » Modeling » EMF » [Teneo] Loading each object in multiple resources
[Teneo] Loading each object in multiple resources [message #799208] |
Wed, 15 February 2012 16:04 |
Ricky de Klerck Messages: 295 Registered: January 2011 |
Senior Member |
|
|
Hi,
We're trying to show a list of persons which input is set as an observablelist. Therefore we have a person EMF Resource which holds all persons. When a person is doubleclicked we want to make a separate resource for this person, so when this resource is saved, only one person is saved.
Is there a way to do this or is this the wrong approach?
[Updated on: Tue, 21 February 2012 10:54] Report message to a moderator
|
|
| | | | | | |
Re: Loading each object in multiple resources [message #799774 is a reply to message #799765] |
Thu, 16 February 2012 09:46 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Ricky,
Comments below.
On 16/02/2012 10:34 AM, Ricky de Klerck wrote:
> Ok, this is my model:
>
> Container
> - 0..* persons : Person
> Person
> - id
> - name
>
> My initial resource is loaded by
> 'hibernate://?sessionController=SC&query1=FROM Container'. My
> tableviewer with all persons is filled with this input: 'new
> EditingDomainEObjectObservableList(getEditingDomain(),
> INITIAL_RESOURCE, ModelPackage.Literals.CONTAINER__PERSONS);'.
So you're using data binding, not the generated editor.
>
> When double clicking on a person, a new view is opened.
That's something you programmed yourself...
> When saving this person the resource of this EObject is still
> 'hibernate://?sessionController=SC&query1=FROM Container', so
> everything in this resource is saved.. I've set containment proxies to
> true, but it doesn't help. I really appreciate your help and I hope I
> can figure this out, cause it's really important.
So your question may be more of what about what does Teneo support?
The best I can suggest is you generate the standard editor and look at
how it behaves. If you've set Containment Proxies to true in your
GenModel and generate the standard editor, the context menu for Person
will have a Control... item on it. You can then use the debugger to see
how ControlAction supports that and from there figure out how you can do
something similar in your hand-written application. I don't know that
Teneo does or doesn't support cross document containment...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | | | | | | |
Re: [Teneo] Re: Loading each object in multiple resources [message #805162 is a reply to message #805030] |
Thu, 23 February 2012 12:13 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
I have limited experience with rcp (I work mostly in web app environments), but I would say that you want to put
everything what needs to be saved together in one resource.
gr. Martin
On 02/23/2012 10:08 AM, Ricky de Klerck wrote:
> True, only changed objects are saved.. but since we make use of databinding, changes are directly put into the object.
> When doing a save on one object, every changed object in that resource is saved.
>
> I understand about the cascade, but shouldn't every person have a it's own resource? We now have one resource containing
> all persons, but shouldn't it be one container resource containing a bunch of person resources? Each person having it's
> own resource? I'm just guessing here..
--
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: [Teneo] Re: Loading each object in multiple resources [message #805232 is a reply to message #805162] |
Thu, 23 February 2012 14:25 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Oeps missed the reply from Tom, in general I don't like the resource concept that much for data-driven applications. I
like it much better to work directly with the hibernate session and do queries. Hopefully Tom will publish a blog post
soon...
gr. Martin
On 02/23/2012 01:13 PM, Martin Taal wrote:
> I have limited experience with rcp (I work mostly in web app environments), but I would say that you want to put
> everything what needs to be saved together in one resource.
>
> gr. Martin
>
> On 02/23/2012 10:08 AM, Ricky de Klerck wrote:
>> True, only changed objects are saved.. but since we make use of databinding, changes are directly put into the object.
>> When doing a save on one object, every changed object in that resource is saved.
>>
>> I understand about the cascade, but shouldn't every person have a it's own resource? We now have one resource containing
>> all persons, but shouldn't it be one container resource containing a bunch of person resources? Each person having it's
>> own resource? I'm just guessing here..
>
>
--
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
|
|
|
Goto Forum:
Current Time: Thu Sep 19 06:47:23 GMT 2024
Powered by FUDForum. Page generated in 0.07512 seconds
|