-->
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.  [ 3 posts ] 
Author Message
 Post subject: Same mapping, different table
PostPosted: Fri Sep 28, 2007 12:13 pm 
Regular
Regular

Joined: Wed Aug 15, 2007 7:37 am
Posts: 73
Given a class

class ReusableThing
{
public int Id
{ get { ... } set { ...} }

public string Description
{ get { ... } set { ... } }

}

.. is it possible to create a single mapping file that can be used to map two instances of this class from different table names? An obvious example would be with collections of lookup values where you might have a number of different tables that contain identical structures. If you were to do this yourself you might add a table name that gets set on construction and use it in a "SELECT id, name FROM " + tablename style affair. You might extend it also to customize the column names.

Apologies if this is obvious / has been answered before, I did have a look around.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 28, 2007 7:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
This is not possible currently. There were some, but not much, discussion here:
http://sourceforge.net/mailarchive/foru ... evelopment

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 01, 2007 4:45 am 
Regular
Regular

Joined: Wed Aug 15, 2007 7:37 am
Posts: 73
Thanks for the reply. I'll keep an eye on things. I might have a look at using the embedded attribute stuff to do this, or just do it myself through ADO. Net.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.