Web hosting unlimited bandwidth - 136 CHAPTER 6 n MAPPING WITH ANNOTATIONS CHAPTER

136 CHAPTER 6 n MAPPING WITH ANNOTATIONS CHAPTER 6 n MAPPING WITH ANNOTATIONS public void setName(String name) { this.name = name; } public void setBooks(Set books) { this.books = books; } public void setAddress(AuthorAddress address) { this.address = address; } } Finally, Listing 6-36 shows the database schema for the classes supporting this chapter, as generated by the Ant hbm2ddl export task for the HSQL database. You will note that we are unable to control the names selected for the foreign key relationships. This is one area in which the Hibernate XML mapping files are superior to the EJB 3 annotations. Listing 6-36. The Database Schema for the Example create table Address ( id integer not null, city varchar(255), country varchar(255), primary key (id) ); create table Author ( id integer generated by default as identity (start with 1), ADDR varchar(255), NATION varchar(255), name varchar(255), primary key (id) ); create table Book ( id integer generated by default as identity (start with 1), pages integer not null, working_title varchar(200) not null, publisher_id integer, primary key (id) ); create table Book_Author ( books_id integer not null, authors_id integer not null, primary key (books_id, authors_id) );
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Leave a Reply