Hibernate version:2.1.8
Hi,
I have a newbie mapping question.
I have a simple class I want to map (
Code:
RewardImpl
). It has a number of easy properties (
Code:
Id, Amount
, etc.) but it also has a property called
Quote:
period
. This is of type
Code:
Duration
.
Code:
Duration
is an interface with many concrete subclasses like
Code:
MonthDuration
,
Code:
SimpleDuration
(2 arbitrarydates),
Code:
YearDuration
etc. The only data they hold is just 2 dates:
Code:
startDate
and
Code:
endDate
.
What I want to do is map this as a component since I do not want to have a different table for durations but I want Hibernate to instantiate the correct subclass. Can I do this within a component?
Am I missing something here?
Thanks in advance,
Harry