Help coderanch get a
new server
by contributing to the fundraiser

Russ R

Greenhorn
+ Follow
since Jun 06, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Russ R

I think that is a very good suggestion.

Using selectXXX gives me the abililty to manage the relationships without using CMR.

thanks alot!
Mastering EJB 2nd edition has a section on 'Dealing w/ Legacy data', but no suggestions for this particular table design.
Thanks Tim. I will most likely just use a Session Bean w/JDBC and populate 2 VO's as you suggest.

Any expert EJB designers with suggestions?

I believe avoiding 'RMI heavy transport' involves using value objects to represent Entity beans rather than calling remote methods on each individual bean property...

Where I work, we use value objects for all Entity beans. We leave one method on the remote component interface visible to the client. This method populates the value object with the values of the Entity Bean properties. Then we ship this value object back to the client application where it can invoke 'local' getters to retrieve individual properties.
Hello all,

I'm working with a legacy database table that cannot be changed. I need to associate each DAY with a set of TIMES.

Here's the structure:

Table Name: DAY

day_id open_time close_time sequence
------ -------- ---------- --------
MONDAY 06:00 AM 08:00 PM 1
MONDAY 10:00 PM 10:30 PM 2
TUESDAY 06:00 AM 08:00 PM 1
WEDNESDAY 06:00 AM 07:00 PM 1
THURSDAY 06:00 AM 04:00 PM 1
THURSDAY 10:00 PM 10:30 PM 2

-The primary key is (day_id, sequence)

Here is what I have so far:

-I think there should be 2 entity beans (DayBean, TimeBean); DayBean has a Collection of TimeBeans
-There is a one-to-many relation from DayBean to TimeBean.

Has anyone else encountered a recursive table as such? Ideas?
Make sure your EJB client jar is in the classpath of your web app.