-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MetaClass for instances rather than for Classes.
PostPosted: Thu Dec 04, 2003 2:07 pm 
Newbie

Joined: Thu Dec 04, 2003 8:51 am
Posts: 3
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!!


Top
 Profile  
 
 Post subject: Re: MetaClass for instances rather than for Classes.
PostPosted: Thu Dec 04, 2003 4:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
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.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.