I am doing a club reservation system using Appfuse 2.0m5 struts basic.

I have two POJO:

1) Club
2) Facility

the relationship of them is, one Club can have many Facilities, apparently
it's one-to-many relationship

Now, when it comes to the booking of the Facility, the facility should have
different rate/fee for different booking type. Tentatively, there should be
a table called FacilityFee to decide the rate/fee based on the booking type.

I am a bit blur that should I make it one Facility can have many FacilityFee
or FacilityFee should inherit Facility ?

My Club & Facility POJO look like this:

In Club POJO, I have

    @Id @GeneratedValue(strategy=GenerationType.AUTO)
        public Long getClubID() {
                return clubID;
        }

    @Column(nullable=false, length=50)
        public String getClubName() {
                return clubName;
        }

    @OneToMany(cascade={CascadeType.PERSIST,CascadeType.REMOVE})
    @OrderBy
    @JoinTable(name="club_facility",
        [EMAIL PROTECTED](name="clubID",
referencedColumnName="clubID"),            
        [EMAIL PROTECTED](name="facilityID"))
        public Set<Facility> getFacilities()
        {
                return facilities;
        }

in Facility POJO, I have :

@Id @GeneratedValue(strategy=GenerationType.AUTO)
        public Long getFacilityID() {
                return facilityID;
        }       

@Column(nullable=false, length=50)
        public String getFacilityDesc() {
                return facilityDesc;
        }

@ManyToOne(fetch = FetchType.EAGER) 
    @JoinColumn(name="clubID")
    public Club getClub()
        {
                return club;
        }


tentatively, the FacilityFee should have:

facilityID
bookingType
hourOfBooking
hourRate

so, 

1) one Facility should have many FacilityFee ?

or 

2) FacilityFee inherits Facility ?


-- 
View this message in context: 
http://www.nabble.com/Advice-for-Hibernate-mapping-tf4257160s2369.html#a12115248
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to