Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] databinding + eclipselink

Thomas,
It depends on what sort of databinding you're doing whether or not you
have to tell your views to refresh. Yes, due to limitations in the
JFace Databinding library you do have to explicitly call refresh on a
_table_.

However if you have a view showing a single entity it will be updated
automatically after your query re-executes you're fine. Keep in mind
both Jason and I when talking about Databinding are referring to JFace
Databinding, which is a common way to do databinding in Eclipse RCP.

If you're using Swing you'll have a different library. My advice is to
get started implementing some things. If something doesn't feel right,
or you want to know if you're doing things a common/correct way let us
know on the list. There's a few of us who have commercial experience
with EclipseLink and RCP Fat Clients.

./tch



On Mon, Feb 16, 2009 at 10:05 AM, Thomas Paradies
<thomas.paradies@xxxxxxxxx> wrote:
> Tim,
>
> wait - I wrote I have to re-execute my query to keep my data up-to-date.
> And, yes I had the hope that EclipseLink "knows" about changes. If
> not, than I have to tell my views explicitly to refresh (as Jason wrote) in
> spite the fact that that isn't my favoured solution.
>
> Nonetheless, thank you for your comments,
>
> Thomas
>
>
>
> ----- Original Message ----
> From: Tim Hollosy <hollosyt@xxxxxxxxx>
> To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
> Sent: Monday, February 16, 2009 3:40:08 PM
> Subject: Re: [eclipselink-users] databinding + eclipselink
>
> You're losing me a bit Thomas. What do you mean you don't have an
> EntityManager? I'm not sure how to use EclipseLink without one, unless
> you're talking about using a non JPA approach, of which things will
> still be analogous.
>
> What problem are you trying to solve? You don't want to re-execute
> your query each time, you want EclipseLink to "know" when your data
> changes in the database and just update the entities here and there?
>
> ../tch
>
>
>
> On Mon, Feb 16, 2009 at 9:37 AM, Thomas Paradies
> <thomas.paradies@xxxxxxxxx> wrote:
>> Tim,
>>
>> without question, but in my scenario I havn't any EM - at least not explicit.
>>
>> Thomas
>>
>>
>>
>> ----- Original Message ----
>> From: Tim Hollosy <hollosyt@xxxxxxxxx>
>> To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
>> Sent: Monday, February 16, 2009 3:22:34 PM
>> Subject: Re: [eclipselink-users] databinding + eclipselink
>>
>> Yep, but entities re-pulled through the same EM will still have the
>> same memory address, correct?
>>
>> ../tch
>>
>>
>>
>> On Mon, Feb 16, 2009 at 9:19 AM, Jason Kusnier <jason@xxxxxxxxxxx> wrote:
>>> I think in that case Tim, you have to tell the TableViewer to refresh
>>> since the property listeners may not get triggered.
>>>
>>> -jason
>>>
>>> On Mon, Feb 16, 2009 at 9:16 AM, Tim Hollosy <hollosyt@xxxxxxxxx> wrote:
>>>> OK,
>>>> So let's say you have your big ol' query. You populate a table with
>>>> 1500 rows. You execute that same query again, tell the table -- here's
>>>> my new list.
>>>>
>>>> The entities are still obtained from the same EM. So they will still
>>>> have the same memory address, so you're still golden!
>>>>
>>>> ./tch
>>>>
>>>>
>>>>
>>>> On Mon, Feb 16, 2009 at 9:11 AM, Thomas Paradies
>>>> <thomas.paradies@xxxxxxxxx> wrote:
>>>>> Tim,
>>>>>
>>>>> the query I'm talking about is a heavy but highly performance optimized
>>>>> object-level query composed by expressions and batch reads. I have to
>>>>> execute this query with session.executeQuery(query) each time because
>>>>> the collection of resulting objects may vary in size - applies to the dependent
>>>>> objects also.
>>>>>
>>>>> So I'm not sure if a call em.refresh(object) in this scenario would be really
>>>>> helpful.
>>>>>
>>>>> Thomas
>>>>>
>>>>>
>>>>>
>>>>> ----- Original Message ----
>>>>> From: Tim Hollosy <hollosyt@xxxxxxxxx>
>>>>> To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
>>>>> Sent: Monday, February 16, 2009 11:38:15 AM
>>>>> Subject: Re: [eclipselink-users] databinding + eclipselink
>>>>>
>>>>> I think we understand each other.
>>>>>
>>>>> Example: You have an eclipse view, a text box is bound to an entity
>>>>> that was obtained through a ReadAllQuery. The binding takes place
>>>>> using the JFace Databinding library, which listens to POJO changes via
>>>>> Property Listeners on your getters/setters.
>>>>>
>>>>> So you refresh that entity -- it still has the same Memory Address as
>>>>> long as it was obtained with the same EM -- the databinding library
>>>>> knows about this change and updates the text box.
>>>>>
>>>>> Are we talking about two different things?
>>>>>
>>>>> ../tch
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Feb 16, 2009 at 4:10 AM, Thomas Paradies
>>>>> <thomas.paradies@xxxxxxxxx> wrote:
>>>>>> Tim,
>>>>>>
>>>>>> may be I'm not clear enough or missing something:
>>>>>>
>>>>>> the refreshing of my objects from database will be done by a job at 1 minute intervals by executing a ReadAllQuery at my session (read-only, no cache checking). The resuling complex object graph is changing over the time - both in the size and the status. Due to these changes involving some but not all objects my UI elements should be notified and updated if the have focus at changed objects.
>>>>>>
>>>>>> To my mind the EclipseLink the change tracking could offer a starting point but it isn't obvious to me if and how it would act with read-only queries.
>>>>>>
>>>>>> Thomas
>>>>>>
>>>>>>
>>>>>>
>>>>>> ----- Original Message ----
>>>>>> From: Tim Hollosy <hollosyt@xxxxxxxxx>
>>>>>> To: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
>>>>>> Sent: Sunday, February 15, 2009 12:51:44 AM
>>>>>> Subject: Re: [eclipselink-users] databinding + eclipselink
>>>>>>
>>>>>> Hi,
>>>>>> Thomas you can absolutely use databinding with EclipseLink!
>>>>>>
>>>>>> I've used EclipseLink with JFace Databinding in an RCP application
>>>>>> quite successfully.
>>>>>>
>>>>>> It works great with Tables and with regular fields -- you do have to
>>>>>> implement Property Field Listeners on your entities to be compatible
>>>>>> with JFace Databinding, but that's easy enough to do.
>>>>>>
>>>>>> Take a look at our RCP Example at my blog:
>>>>>>
>>>>>> http://www.weheartcode.com/2008/08/27/eclipselink-in-j2se-rcp-applications/
>>>>>>
>>>>>> It uses JFace databinding on tables and fields I believe.
>>>>>>
>>>>>> Let me know if you have any questions.
>>>>>>
>>>>>> Tim
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Fri, Feb 13, 2009 at 9:18 AM, Thomas Paradies
>>>>>> <thomas.paradies@xxxxxxxxx> wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm building a monitoring application with the need for explicitly refresh a bunch of objects from a database at regular intervals. Is there a way to observe and propagate changes at/in the objects due to the refresh as eclipse databinding offers? Perhaps its possible to couple eclipselink and eclipse databinding seamlessly?
>>>>>>>
>>>>>>> Thomas
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> eclipselink-users mailing list
>>>>>>> eclipselink-users@xxxxxxxxxxx
>>>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>>>
>>>>>> _______________________________________________
>>>>>> eclipselink-users mailing list
>>>>>> eclipselink-users@xxxxxxxxxxx
>>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> eclipselink-users mailing list
>>>>>> eclipselink-users@xxxxxxxxxxx
>>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>>
>>>>> _______________________________________________
>>>>> eclipselink-users mailing list
>>>>> eclipselink-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> eclipselink-users mailing list
>>>>> eclipselink-users@xxxxxxxxxxx
>>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>>
>>>> _______________________________________________
>>>> eclipselink-users mailing list
>>>> eclipselink-users@xxxxxxxxxxx
>>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>>
>>> _______________________________________________
>>> eclipselink-users mailing list
>>> eclipselink-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
>>
>>
>>
>>
>> _______________________________________________
>> eclipselink-users mailing list
>> eclipselink-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>
>
>
>
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top