epbernard wrote:
Unions are not doable AFAIK
Try to do this kind of mapping:
Create a News class, create News2002, News2003 as subclasses.
Map as table-per-concrete class (map News2002 and News 2003 but not News). And play with that.
This solution has many drawbacks, and probably don't be appropriate in your case.
Submit a request to JIRA for you initial feature, Gavin will tell you if you can expect that in a future Hibernate.
I don't know what's JIRA??
how can i contact Gavin to suggest my advice as below?
When one develop a website such as a news website.
It its very easy to consider making a generic News.class to
fit for all kinds of news.
eg. A news may have title, content, date ...
so we develop a News.class.
but we have different news, like entertaiment, sport, government, techinical .....
so, we must have dynamically mapping to News.class
News.class should associate to several *.hbm.xml file, each file figure to a table.
like News.sport.hbm.xml, News.entertaiment.hbm.xml
(May be we can specify the different table name just in the filename)
and the Configuaration can read all xml
and one can query News.class in all different table or only one table.
That's what i except mostly of the future hibernate.