Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using Observable Lists within entity classes?
Using Observable Lists within entity classes? [message #516797] Thu, 25 February 2010 03:49 Go to previous message
Olu  is currently offline Olu
Messages: 29
Registered: October 2009
Junior Member
I have 2 entity classes which both have collections of each other's type in many-many config. something like the code below:-

@entity 
@Table(name = "A")
...
@JoinTable(name = "JOIN_TBL",
        joinColumns = @JoinColumn(name = "COL_ID"),
        inverseJoinColumns = @JoinColumn(name = "J_COL_ID"))
private Collection<B> BCollection;
...

and then

@entity
@Table(name = "B")
...
    @ManyToMany(mappedBy = "sembookingsCollection", cascade=CascadeType.ALL,fetch=FetchType.EAGER)
    private Collection<A> ACollection;
..

Within the application I bind ACollection to a JTable...

org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${selectedElement.ACollection}");
org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, masterTable, eLProperty, detailTable);



The above is all pretty standard stuff and my JTable doesn't get updated after changes to ACollection.

I can see I an Observable wrapper around the ACollection might do the trick but Observable Lists are not supported in the JPA spec. for entity classes.

Setting fetchType to EAGER doesn't solve the problem (and perhaps it shouldn't).

Apart from observable lists I can't see how to update a list in real time. Does anyone have a solution to this issue?

many thanks,
 
Read Message
Read Message
Read Message
Previous Topic:Invalidation and JPA
Next Topic:OneToMany does not populate Foreign Key or null foreign key
Goto Forum:
  


Current Time: Mon May 20 01:41:17 EDT 2013

Powered by FUDForum. Page generated in 0.01580 seconds