• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Netbeans - Persistence Add Record To Child Table

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if this belongs here or in Object Relational Mapping.
I'm working with the gui tools in netbeans to create a java persistence project.
I have two entities, A and B which have a one to many relationship, A being the owner. I have all the relationship stuff taken care of and it works so far.
I have Jframe with a master table, displaying records from A. The table is bound to a list which gets its results from a persistence query from an entity manager. Then I have a detail table which is bound through the master table's selected element and displays the records from the child table, B.
Now I want to add a record to the child table, B. I understand how to do this on the master table, essentially adding a row to the list that the table is bound to. But my detail table is not bound to a list. Can anyone help me understand how to add a record to the child table?
Thanks.
 
Bill Hayes
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I figured out how to add the record to the child table. At least it seems to work when I query the database from a different tool. Now my problem is that I can't get the child table to refresh. I need to be able to refresh the child table (to see the new record) and also maintain the selections in the master table and also two other child tables.
 
Bill Hayes
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been working on this for about a month and a half with no luck. I am able to add a record to the table as I can go in through a query tool and see the new record. It doesn't appear in my JTable unless I leave the current master record then select that record again. There must be something simple I'm missing.
 
Always look on the bright side of life. At least this ad is really tiny:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic