CHAPTER 6 n MAPPING WITH ANNOTATIONS (Hosting web) 137 n
CHAPTER 6 n MAPPING WITH ANNOTATIONS 137 n MAPPING WITH ANNOTATIONS 137 create table ComputerBook ( BOOK_ID integer not null, softwareName varchar(255), primary key (BOOK_ID) ); create table Publisher ( id integer generated by default as identity (start with 1), name varchar(255), address_id integer, primary key (id) ); alter table Book add constraint FK1FAF0990BF1C70 foreign key (publisher_id) references Publisher; alter table Book_Author add constraint FK1A9A0FA1B629DD87 foreign key (authors_id) references Author; alter table Book_Author add constraint FK1A9A0FA1D3BA8BC3 foreign key (books_id) references Book; alter table ComputerBook add constraint FK98D97CC4600B1724 foreign key (BOOK_ID) references Book; alter table Publisher add constraint FKCDB7C1DC158ECEF0 foreign key (address_id) references Address; Summary In this chapter, we used EJB 3 annotations to add metadata to our POJOs for Hibernate, and we looked at the Hibernate-specific annotations that can enhance these at the cost of reduced portability. In the next chapter, we discuss the alternative approach of using XML mapping documents to express the mapping requirements.
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services