I have a query regarding the entity bean.
I am developing an application in which I am representing the "Card" as an entity bean. Since a card can be fall into different types like "Credit Card", "Debit Card" and etc..
Debit, credit or other card will have some common featutes like card expiry date, card issued by, and others.
So I will be mainitaining it in "Card" entity bean.
The features specific to individual card like Credit Card will have Credit Limit, whereas debit card won't have such feature.
So feature specific to individual card will be maintained at specfic entity bean like "DebitCard", "CreditCard"..
Whether it's right way of doing it? Whether I can able to use inheritance in entity beans? How to have the relationship with "Card" and "DebitCard", "CreditCard"?
Please throw some light on it.
Mark, you can have inheritance on entities. If you are using EJB 3.0, and if you do NOT need to map the super class (i.e. Card class) directly to the database, you could annotate the Card class as a MappedSuperClass and other sub classes (i.e. CreditCard, DebitCard can be exposed as entities to the database by using the @Entity annotation. In this case the Card class is used to provide the common information for sub classes.
And if you really need to map the super class too (i.e. Card class itself), there are some mapping strategies you can use. But I think the MappedSuperClass is what you really needed here.