Recently I was looking at connecting my MIDlet with a backend application running in Sun AS 9, of course developed in NetBeans as well and since I am not really sure whether or not WS are supported by the phones the MIDlet will run on, I generated, well I had NB generate the web connectivity. Really cool stuff.
Then I wanted it all to work, ie send data from the phone to the backend and have the data stored in a database, Java DB included by NB. To get some grips on the whole Java EE 5 thing, I had NB generate a CRUD frontend for the entity classes and I looked at the generated code. This is actually rather clean code and very comprehensive indeed. But from the NB generated servlet unusable. It took me some digging in the Java EE 5 tutorial to find out how to get it all up an running with PersistenceUnits, Resources, annotations and transactions, but I got it all running in the end. I added the annotation of the Persistence Unit to the generated servlet and changed the EndToEndSupport class (I'm not really sure that it is called exactly that way, but it was generated by NB during the generation of the backend connectivity). The change included providing the EntityManager obtained in the servlet to the actual code that is to do the persistency. This was about 2 minutes of work and I was thrilled to see it all working.
Now the "Ooops I did it again" comes into play. I changed the backend functionality a bit, or rather I moved some classes and added some features which wasn't a problem until I had NB generate the code again so I could use the new backend functionality from the MIDlet. All code I had changed to get the persistence working was gone. Fortunately I remembered what I had done, and it all was still in SVN, so not too much harm done.
And this is when I started wondering about where that checkbox is that asks me whether or not I want to use the JPA in the backend I am connecting to from my MIDlet and when checked it will generate all the code for actually persist data send across.... or maybe I am not looking in the right direction to read all about it. Anyway, the tutorial on mobility assumes a working webapp, the web tutorial assumes JSF to be used and it doesn't all come together in one tutorial... maybe I'll document my efforts more detailed, until then: Drop me an email if you get stuck on this.
E-One
Showing posts with label MobPack. Show all posts
Showing posts with label MobPack. Show all posts
Wednesday, December 13, 2006
Wednesday, November 15, 2006
NetBeans Mobility Pack for CDC final?
I've played with the final release of NB55 and it really is great. I have some gripes still (Can't get the UML projects into SVN, this just doesn't seem possible). I'll file an issue sometime soon.
The UML projects are great though. Especially for Java ME stuff, a good design is really important when you have to put good programming practices aside because that just isn't efficient enough. Sofar I've used the State Diagram and some Class diagramming. But it really is great. Works pretty much like a charm, although there are some little nuisances. All will be files as an issue once I know it's not me.
Another little issue is the fact that the CDC version of MobPack isn't available for the final release. Integration of emulators from Sony Ericsson and Nokia still seems less than excellent. But the lack of a final version is a shame.
Any ideas on its release NB MobPack guys?
Iwan
The UML projects are great though. Especially for Java ME stuff, a good design is really important when you have to put good programming practices aside because that just isn't efficient enough. Sofar I've used the State Diagram and some Class diagramming. But it really is great. Works pretty much like a charm, although there are some little nuisances. All will be files as an issue once I know it's not me.
Another little issue is the fact that the CDC version of MobPack isn't available for the final release. Integration of emulators from Sony Ericsson and Nokia still seems less than excellent. But the lack of a final version is a shame.
Any ideas on its release NB MobPack guys?
Iwan
Subscribe to:
Posts (Atom)