Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Netbeans - Persistence Add Record To Child Table

 
Bill Hayes
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic