Witam. Stworzyłem swoją bazę danych: ePrzychodnia w postgre i umieściłem w niej następującą tabelę:
CREATE TABLE users
(
user_id integer NOT NULL,
first_name character varying(25),
last_name character varying(25),
pesel character varying(11),
email character varying(25),
usertype character varying(25),
login character varying(25),
pass character varying(25),
CONSTRAINT pk_users PRIMARY KEY (user_id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE users
OWNER TO postgres;
Teraz chcę stworzyć entity bean w swoim projekcie EJB. Postępuję zgodnie z tutorialem:
1.In NetBeanse IDE right-click on JumpStartEjbJsf-ejb and select New > Entity Classes from Database…
2.In the New Entity Classes From Database dialog box select Data Source: jdbc/test_db.
3.In the New Database Connection that then pops up it should read the values from the table below…
4.Click OK.
5.On the next tab Advanced select Schema public.
6.Back in the New Entity Classes From Database dialog box add the Users table to Selected Tables.
7.Click Next.
8.Change the class name from Users to User
9.Fill in the package name lux.domain.
10.Click the Create Persistence Unit button and accept the defaults.
11.Uncheck Generate Named Query Annotations for Persistent Fields.
12.Click Finish.
Dochodzę do punktu 5, wszystko jest ok i w punkcie 6 następuję problem kiedy mam dodać tabelę. W sekcji Available tables nie widać żadnej tabeli. Dlaczego? Przecież stworzyło mi poprawnie połączenie z bazą. Wchodząc w zakładkę services->database jest moje połączenie. Jeśli je rozwinę wejdę w public->tables widzę swoją tabelę users. Zupełnie nie wiem czemu nie widać w podpunkcie 6 tej tabeli. Używam w projekcie Netbeans, glassfish, postgresql.