-->
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: Applying @Check Constraints On Secondary Tables
PostPosted: Fri Jun 30, 2006 7:54 am 
Newbie

Joined: Thu Dec 01, 2005 12:23 pm
Posts: 19
Hi,

does anybody know if and how I can apply Hibernate @Check constraints on secondary tables?

Imagine following class hierarchy:

Code:
@Entity
@Table(name = "class_a")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "discr", discriminatorType = DiscriminatorType.STRING, length = 1)
@DiscriminatorValue("A")
public abstract class A {
...
}


and

Code:
@Entity
@Check(constraints = "flag = true")
@SecondaryTable(name = "class_b")
@DiscriminatorValue("B")
public class B extends A {
..
    @Column(table = "class_b", name = "flag")
    private boolean flag;
}


The code snippets should describe what I'd like to achieve. Unfortunately the @Check constraint on class B does not produce any output when generating the database DDL.

When I place the @Check constraint from above to class A, the generated DDL contains the contraint, but on table class_a. :(

So any idea how I may apply such a @Check constraint to a secondary table? Thanks in advance for your help!

Regards,
bitbyter


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 10:02 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
open an hibernate core feature request

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 5:13 am 
Newbie

Joined: Thu Dec 01, 2005 12:23 pm
Posts: 19
Done: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1919


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.