pacopaco wrote:
Can I build an hibernate's mapping for an instance rather than for a class?
I want to get diferent instances of the same class (Layer) with different MetaClass proxys, and associate them in Hibernate session.
Why?
like this I could have two instances (layerRiver and layerCountry) of the same class (Layer) working against different tables with different Schemas (river's table and country's table).
Must I extend and OverWrite Hibernate Session?
How can I do that, or where must I look?
Thanks in advance!!
(dude - that mapping strategy sounds really weird - so the following tip is for your own sick mind and risk ;)
If you are wrapping them with another class - then they ARE different classes! Thus, if you can just control the naming of the generated class then you can just map that class e.g. "Layer$X" and "Layer$Y" or something.
You then just need to build a mapping document "on-the-fly" where the classname is "Layer$X" in one situations and "Layer$Y" in the other.