-
1. Re: @AttirbuteOverride and unique contraints
phon May 19, 2006 2:36 AM (in response to phon)i'm been trying to solve this some more and it seems that the @AttributeOverride annotation is ignored altogether..
I've tried to put it on various classes in the class hierarchy including both @MappedSuperclass and @Entity , both leave and non-leave classes. I tried overriding the name of the column, the nullability, the uniqueness etc. Even if i try to override some column "THISCOLUMNDOESNTEXIST" , i have no error or message whatsoever..
the class hierarchy is :
(@MappedSuperclass) BaseEntity -> (@Entity) Document -> (@Entity) InternDocument -> (@Entity) LeaveDocument
none of the following works :@Entity @AttributeOverride(name="code",column=@Column(nullable=false)) public class LeaveDocument extends InternDocument {
@Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @AttributeOverride(name="code",column=@Column(name="anothercode")) public abstract class InternDocument extends Document{
@Entity @Inheritance(strategy=javax.persistence.InheritanceType.TABLE_PER_CLASS) @AttributeOverride(name="THISCOLUMNDOESNEXIST",column=@Column(nullable=false)) public abstract class Document extends BaseEntity {
-
2. Re: @AttirbuteOverride and unique contraints
epbernard May 19, 2006 9:42 AM (in response to phon)I have some unit tests for that but if you can build a minimal runnable test case to reproduce it, I'll have a look. Be sure to use the latest versions.
http://opensource.atlassian.com/projects/hibernate/secure/Dashboard.jspa