• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do equivalent to RDMS Domain Tabloes in EJB?

Robert Paris
Ranch Hand
Posts: 585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I BEST implement the following in EJB?

In RDBMS I might have Customers all with many types of Addresses. That relationship could be modeled by:

CustomerTable --> CustomerAddressesLinkTable <--AddressTable

Where you put a unique constraint on the AddressID in the link table and make the combo of the two keys (CustomerID + AddressID) the primary key.

OK, so far I'm fine in translating this to EJB.

Now we say that Customer's can have a Work Address, a Home Address, etc. In a database I'd simply have a Domain Table (or Type Enumeration Table) that links to AddressTable:

AddressTable <--AddressType

Where AddressType would be:

1, "Work Address"
2, "Home Address"


I'm not sure where to put this info in EJB. It doesn't seem right (or seems like overkill and a misrepresentation) to make it an Entity Bean. I'm also not sure how I'd make it a part of AddressBean since in the database it should be in its own table. Any ideas?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic