0

I have a problem:

  1. I am working at a Java EE project, the GUI is writting by other persons.
  2. I cretaed the database
  3. I wrote a Java SE application (with Netbeans 7.1) which contains the entities (I let Netbeans generate these from database and fitted them)
  4. I wrote the testclasses, wrote the ejbs and tested them.
  5. I than wrote a singleton webservice in which the other beans are injected.
  6. I the webservice, I got the expected result: it's possible to get the list of all instances (rows in the database), get an instance of an instance by ID, update and save it: all CRUD operations are OK.
  7. In the Client, a Java SE Application (with Netbeans 7.1), I added a "web service client" by specifying the WSDL URL (of the webservice created in 6).

All what I got are detached objects. Every object with its all fields (as strings) EXCEPT THE ID (Primary Key). instead of an update, I got an insert (cause the edited object has no ID on the client). Remove doesn't work at all. Other operations (findAll, findById) are OK. Do I have to use DTOs (Data Transfer Objects)? I read that these are not more needed as of ejb3.1

On the client, for a findAll operation, Netbeans does not accept to use the entities: it forces me to use the autogenerated "dtos", which have almost the same fileds (except thhe primary key or ID) as the entities but as strings.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140

1 Answers1

0

Problem solved. I don't know why but Netbeans has autogenarted DTOs without the primary keys, therefore not all CRUD were possible. This took me a long time and caused lot of headache!

Meziane