Java Reference
In-Depth Information
Annotation
Description
Annotation Elements
@MapKey
Defines the map key for
associations of type java.
util.Map.
name (optional): The name
of the persistent field or
property of the associated
entity that is used as the map
key.
@PrimaryKey
JoinColumns
Defines composite foreign
keys.
value (optional):
Specifies one or more
PrimaryKeyJoinColumn
annotations.
@PrimaryKeyJoinColumn Specifies a primary key
column that is used as a
foreign key column to join
to another table.
name (optional): The name
of the primary key column of
the current table.
referencedColumnName
(optional): This is the name
of the primary key column of
the table being joined to.
columnDefinition
(optional): The SQL
fragment used to generate
the DDL for the column.
Setting the environment
We shall be using the WebLogic server integrated with JDeveloper 11 g . Download
and install JDeveloper 11 g Studio edition ( http://www.oracle.com/technology/
software/products/middleware/index.html ). We also need to download
and install Oracle database ( http://www.oracle.com/technology/software/
products/database/index.html ). Include the sample schemas when installing
Oracle database. As we are using multiple entity beans, we need to create some
database tables to which the entity beans are mapped.
Creating database tables
Create tables CATALOG , EDITION , SECTION , and ARTICLE with the following
SQL scripts:
CREATE TABLE CATALOG (id INTEGER PRIMARY KEY NOT NULL,
journal VARCHAR(100));
CREATE TABLE EDITION (id INTEGER PRIMARY KEY NOT NULL,
edition VARCHAR(100));
CREATE TABLE SECTION (id VARCHAR(100) PRIMARY KEY NOT NULL,
sectionName VARCHAR(100));
CREATE TABLE ARTICLE(id INTEGER PRIMARY KEY NOT NULL,
title VARCHAR(100));
Search WWH ::




Custom Search