views:

888

answers:

1

Hello,

I want to achieve basic CRUD operations available of the db schema I already have for a JAVA program. To put it in another way, I have a DB schema I use with PHP and I just need them to be entities available in a JAVA application. I discovered I can use Netbeans and sucessfully created Entities from DB!

(Entities look like this: http://pastebin.com/f601b9218)

However when I try to create New > JPA controllers from entity classes in Netbeans I got empty JPA controller classes like:

package javaapplication3;
public class CustomerJpaController {
}

It is empty :) I was expecting CRUD functions inside the generated JPA controller classes as I read from examples and tutorials. What could be the reason of empty JPA controller classes? Is there any other easy way for me to "just" match DB tables with JAVA classes for basic CRUD operation. (I wish there could be easy way to achieve active record pattern)

Thanks in advance.

+1  A: 

Usually, I never like to go too much with the wizard thing. But it seems like it should generate the basic CRUD operations, though. I don't know exactly which tutorial you followed. Right now, I am looking at this. After reading this I am getting the same impression, by the way. But may be it just generates the empty classes, and nothing else. I am not sure never tried to do that.

However, coding it yourself would be quite simple, I believe. Especially when you already got the NamedQueries defined for your entities.

Adeel Ansari
No it is not just supposed to generate empty classes. Here I found something related with that: http://tinyurl.com/ycf86gwSo I tried what he suggested to fix this problem and it works on my Win7-64bit environment. But it is unhandy to manually go through the generated entity classes before generating JPA controllers.
celalo