Netbeans Tip: Add, Update and delete Database data using JPA and Table Component

In my previous blog Binding Database Table to a Table Component Using JPA, I wrote about the ability to directly bind Netbeans Visual Web Pack Table Component to an array of Entity Beans and fill that array with data from a database using JPA (Java Persistence Architecture)

I have written another walk through that explains how to Add, Update, and Delete rows in a Database Table, Using JPA and Netbeans Visual Web Pack Table Component.

This walk through tutorial is available at this link - Add, Update and delete Database data using JPA and Table Component

Comments:

Can't wait to read this one. Thanks Winston.

Posted by C Kutler on April 27, 2007 at 02:02 PM PDT #

Hi, now the only thing that I need is how to made a dialog search with JPA VWP! I have a product, and it have a type. When I click change type button, a "type search" dialog will show and when I select a new type, the dialog close and in my product form show me the new type! If someone know where I found! Thanks a lot! PS: sorry about my English.

Posted by Fabio Mello on May 07, 2007 at 05:02 AM PDT #

Thanks Winston for this one. I like the Design and the arrangement of the add/update/delete and also the logic used to hide and show panels.

I need an advice though on some Design:

I have a Master Table, on my Page, and this is bound to an ObjectListDataProvider, which gets its Data from the Database.

Now, my requirement is to have a Child Table within this Master Table, which would the show all the child records for the current Master Record.

This is a typical Master-Detail scenario, all the Master and child records have to be shown at once when the page starts. The Columns for the master and Detail Table are known and fixed, but the rows for both Tables are dynamic. something like this:

|---------------------------------------|
|Master             Detail              |
|col1           col1      col2          |
----------------------------------------|
| master1       detCol1r1 detCol2r1     |
|               detCol1r2 detCol2r2     |
|               ...       ...           |
|               ...       ...           |
----------------------------------------|   
| master2       detCol1r1 detCol2r1     |
|               detCol1r2 detCol2r2     |
|               ...       ...           |
|               ...       ...           |
|                                       |
|---------------------------------------|
|......                                 |
|......                                 |
|                                       |
|---------------------------------------|
Can this be done at Design Time or should i build both Tables manually through code.
Regards,
Pasko

Posted by guest on August 02, 2007 at 11:36 PM PDT #

a similar problem from this thread: http://forum.java.sun.com/thread.jspa?threadID=746112&messageID=4271146

Posted by guest on August 02, 2007 at 11:48 PM PDT #

Hi, I have the same problem please help.
Thanks

Posted by Christian on August 20, 2007 at 05:01 PM PDT #

hi, i want use JPA but i´m not sure to use netbeans 6 (Still in BEta). Can i use JPa (this example) with netbeans 5.5.1?

Posted by javiersinnada on November 05, 2007 at 01:53 AM PST #

Hi Javier, yes you can use this in NB 5.5.1 also, except that you have to create ObjectArrayDataProvider or ObjectListDataProvider to hold the POJOs obtained via JPA and then bind it to the table.

Posted by Winston Prakash on November 05, 2007 at 02:24 AM PST #

Can we do this (Use JPA) in Studio Ctreator?

Posted by Matara on February 18, 2008 at 11:55 AM PST #

Hello Winston , iam using this example to adapt it to a personal proyect of mine and i cant get it to work i mean, i cant get to get the selected rows.... i dont know what iam doing wrong... could you please email me your example so i know exactly what to put... i dont need the database... just the JSF and Java.. ill appreciate it a lot

Posted by Nazario on April 13, 2008 at 08:14 AM PDT #

Hi

I have a problem with this application in Netbeans 6.1.
The first time the page opens, or when I click add or update, the table shows no text (but has the correct number of rows and cols) and the other controls are not displayed.
When I click refresh, the page is displayed correctly.
Could it be something related to jpa?

thanks

Posted by charly on October 08, 2008 at 11:23 PM PDT #

Well, this happens with firefox3. In IE it works, so I think it might be a firefox issue.
I've also seen that the page contains the data, but it doesn't get displayed.

Posted by charly on October 08, 2008 at 11:33 PM PDT #

I have a GPS system on my car bought from http://www.lweshop.com/ and it really has helped enormously in finding new locations. I found this blog most interesting as I didn’t realize all of the wide range of applications out there today for GPS technology

Posted by Car GPS systems on December 21, 2008 at 10:13 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today