Entries from October 2008

EJB3: Mapping Persistent Objects Example 5

October 21, 2008

Following are the example from the chapter “Mapping Persistent Objects” from the book “Enterprise JavaBeans 3.0″ by Bill Bruke & Richard Monson-Haefel. This example I have tried it out on JBoss AS 5.0.0.CR1. I have used Postgresql as the database. And I have used eclipse WTP as IDE.

Example 5: Embeddable Classes
This example shows the use […]

EJB3: Mapping Persistent Objects Example 4

October 21, 2008

Following are the example from the chapter “Mapping Persistent Objects” from the book “Enterprise JavaBeans 3.0″ by Bill Bruke & Richard Monson-Haefel. This example I have tried it out on JBoss AS 5.0.0.CR1. I have used Postgresql as the database. And I have used eclipse WTP as IDE.

Example 4: Multitable Mappings
This example shows the use […]

EJB3: Mapping Persistent Objects Example 3

October 21, 2008

Example 3: @EmbeddedId
This example shows the use of @javax.persistence.EmbeddedId to map a primary key class to the database and also the use of @javax.persistence.Transient annotation.

Client.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.titan.clients;
 
import com.titan.travelagent.TravelAgentRemote;
import com.titan.domain.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
 
public class Client {
public static void main(String[] args) {
try {
Context jndiContext = getInitialContext();
Object ref = jndiContext
.lookup("TitanCruises/TravelAgentBean/remote");
TravelAgentRemote dao = (TravelAgentRemote) ref;
 
CustomerPK pk = new CustomerPK("Burke", […]

EJB3: Mapping Persistent Objects Example 2

October 21, 2008

Following are the example from the chapter “Mapping Persistent Objects” from the book “Enterprise JavaBeans 3.0″ by Bill Bruke & Richard Monson-Haefel. This example I have tried it out on JBoss AS 5.0.0.CR1. I have used Postgresql as the database. And I have used eclipse WTP as IDE.

Example 2: @IdClass
This example shows the use of […]

EJB3: Mapping Persistent Objects Example 1

October 21, 2008

Following are the example from the chapter “Mapping Persistent Objects” from the book “Enterprise JavaBeans 3.0″ by Bill Bruke & Richard Monson-Haefel. This example I have tried it out on JBoss AS 5.0.0.CR1. I have used Postgresql as the database. And I have used eclipse WTP as IDE.

Example 1: Basic Property Mappings
This example shows the […]