« Return to Thread: [core] New Desktop Database Application Wizard resulting application behaviour

Re: [core] New Desktop Database Application Wizard resulting application behaviour

by RobertPage :: Rate this Message:

Reply to Author | View in Thread

Hi Janie,

   Once again, you have been a great help! I appreciate the explanation and the work-around.
I just made the change in my sample form and it works much better. Maybe there will be a tutorial
that includes that step, at least until it makes it into a standard release.

   I agree that the forms the wizard produces are meant to be a learning aid, and not a
real-world application. I'm using them for exactly that as I read over John O'Connor's article
"Using the Java Persistence API in Desktop Applications". [1]  My problem was that even the
simple demonstration form wasn't working. ;)  It's all good now.

   Is it safe to assume that the JPA is the best way to implement database forms and projects?
One of the things I love about Java is that there is continual progress. I started working with result sets
and data retrieval. From there I started with forms using rowSet implementations. I was about to get into
serious prototyping with that when NetBeans 6 came out and seemed to be pointing to the JPA. (Which is
an improvement.)

   Also, I think that what the database application wizard/dialog does is incredible. The code it produces
 has been a big help to me in understanding annotations and persistence. There was just that one major
issue, and now you've given me the work-around for it.

Thanks again,
Robert


[1] http://java.sun.com/developer/technicalArticles/J2SE/Desktop/persistenceapi/

Jana Maleckova wrote:
Hi Robert again ;),
complication connected with creating new record in detailed table there
is known issue. This is a consequence of the latest update of Beans
Binding library. We don't want to deal with ObservableCollections in our
master/detail template (it is not straightforward when using JPA).
Hence, we force the update of the detail table by un-selection and
re-selection of the corresponding row in the master table. This worked
with the previous versions of the library because they worked as if they
had 'sourceUnreadableValue' set to 'null' for all bindings. Now, when
the selection is cleared then nothing happens because
'sourceUnreadableValue' is not set for 'detailTable.elements' binding.
The fix is to set 'sourceUnreadableValue' of this binding to 'null'. It
has been already solved  in trunk, but not for NetBeans 6.0 because it's
too late :o(. If you want to fix that in form/application generated by
NetBeans 6.0, follow these steps:

1. Select detailTable
2. Switch to Binding category in Properties window
3. Select elements property
4. Invoke property customizer (Press ... button)
5. Switch to Advanced tab.
6. Check 'Unreadable Source Value' (<none> should be selected in combo
next to this check-box).
7. Press OK.

FOR NOTE:
All the templates which are generated during building process of JDA
project, should demonstrate the way how to use JPA and beans binding. We
don't want to overload users with very complicated code. and therefore
please don't confirm this as a real - world application. It's really
just a sample.
Thanks for understanding ;o)

Regards
Janie

 « Return to Thread: [core] New Desktop Database Application Wizard resulting application behaviour