Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
EJB and other Java EE Technologies
Entity Bean with Multiple Tables
Joined: Dec 20, 2004
Dec 20, 2004 07:59:00
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
Fields: addressId, address
I want my entity bean to contain 2 variables: "username", "address".
Kunaal A Trehan
Joined: Feb 04, 2004
Dec 22, 2004 04:07:00
Entity beans have provided with cmr field so that u can get the data from the related tables using entity beans
Joined: Feb 13, 2004
Dec 23, 2004 22:49:00
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.
Don't get me started about those stupid
subject: Entity Bean with Multiple Tables
Why is my Hibernate Search query not working?
When to use what
Map to View
hibernate mapping problem
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013