-->
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.  [ 8 posts ] 
Author Message
 Post subject: two discriminator values in inheritance??
PostPosted: Thu Mar 04, 2004 10:47 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
Hello,

We have a table element that has two columns

element_type varchar(1)
and
element_subtype integer

defining the class of a row ( a row with types [a,1] has a class different from a row with types [a,2]...).

As you can imagine, this is a given design that cannot be changed.
What could be a possible mapping of this table to hibernate?

My study of the hibernate dtd showed, that discriminator allows just one column. (<!ELEMENT discriminator (column?)>) Is there any hope for us?

Salut Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 5:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No hope.
But you could try to do a patch on that.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 4:53 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
Merci for the answer. I think, that the solution will be, not to map the class hierarchy in the persistent classes at all. The class hierarchy will be represented just in the value objects.

Salut, Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 13, 2004 4:47 pm 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
....but on the other hand, writing this patch would be an good opportunity to enter into hibernate source code.

Let's say I would write a patch. This patch would imply minor changes in very basic classes, I suppose. And a change in the mapping dtd. Would this patch be accepted and integrated into future hibernate releases ?

More general:

If I would like to implement a new feature for hibernate, but only under the condition, that there is a good chance, that my code is integrated in future releases of hibernate?

Which formal steps do I have to proceed?

Any coding conventions?

Any testing conventions?

And in the end I have to submit the patch to jira, and if it is written correctly it will be integrated into future releases, true?

Salut, Thomas[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 14, 2004 5:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
Would this patch be accepted and integrated into future hibernate releases ?


No promises. Depends how upon elegantly it was implemented, and upon whether the extra complexity was "worth it".

Quote:
Which formal steps do I have to proceed?


There is no formal procedure. It helps to propose new functionality to the devel list first, just to check that we think it is not a Bad Idea.

Quote:
Any coding conventions?


There is a checkstyle ant task

Quote:
Any testing conventions?


New functionality should be accompanied by unit tests, of course. The test should extend net.sf.hibernate.test.TestCase

Quote:
And in the end I have to submit the patch to jira, and if it is written correctly it will be integrated into future releases, true?


Only if we like it. :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 6:19 am 
Newbie

Joined: Sun Dec 28, 2003 4:35 pm
Posts: 13
Hello Gavin,

of course you do not want to guarantee anything. But you must also understand my point of view. I don't want to write something, if from the there is no chance that it enters the code.

So for my concrete case, please encourage me("Yes Thomas, if you do that thing in an elegant way, there is a good chance, that it enters") or discourage me ("This change wil affect much too basic classes, and I cannot imagine, that you can do this in a acceptable way.")

Salut, Thomas


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2004 6:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Well, its an existing feature request that has not been rejected, so it is something we will certainly consider. My main concern is how discriminator values are assigned to transient (and detached) instances. I guess a new Interceptor callback could solve that one.

Note that you should work against the v22branch for this kind of new functionality.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 12:58 pm 
Beginner
Beginner

Joined: Wed Mar 30, 2005 5:41 am
Posts: 40
gavin wrote:
Well, its an existing feature request that has not been rejected, so it is something we will certainly consider. My main concern is how discriminator values are assigned to transient (and detached) instances. I guess a new Interceptor callback could solve that one.

Note that you should work against the v22branch for this kind of new functionality.


Hi,

What is the evolution ? The posts below are quite olds, Is it now a way to use multiple discriminator columns to do the inheritance mapping ?

My problem is exactly the same as rimmele7...

I saw a few swiss people on this forum, I live in Geneva and my english is very limited, so if a compatriot would help me in french, please contact me : lilian dot robert at gmail.com


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