aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Entity Bean with Multiple Tables Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Entity Bean with Multiple Tables" Watch "Entity Bean with Multiple Tables" New topic
Author

Entity Bean with Multiple Tables

Adam Kostyk
Greenhorn

Joined: Dec 20, 2004
Posts: 1
Hi,

I am having trouble finding an example of an entity bean using multiple tables.

Could someone give an example of how to implement entity bean that pulls data from multiple tables.

As an example I have 2 tables:

Table name: tblUser
Fields: username, addressId

Table: tblAddress
Fields: addressId, address

I want my entity bean to contain 2 variables: "username", "address".
Bean:username, address
Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Posts: 63
Hi

Entity beans have provided with cmr field so that u can get the data from the related tables using entity beans

Rgds
Kunal
Seetesh Hindlekar
Ranch Hand

Joined: Feb 13, 2004
Posts: 244
Hello Adam,

Which scenario are you looking for?

1. Single Entity bean mapping to 2 tables
JBuilder 9 provides Multiple Table mapping provided you have defined 2 Entity Beans each mapped to a single table as mentioned in pt 2.

2. Two Entity Beans each mapping to a single table (usually defined with CMR)

I am still looking for answers to the same query you have and how to insert/select records from 2 tables using a Single Entity Bean.

Keep me posted if you get something valuable.

Rgds,

Seetesh
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Entity Bean with Multiple Tables
 
Similar Threads
CMR
When to use what
Map to View
Why is my Hibernate Search query not working?
hibernate mapping problem