Hibernate only uses the discrimnator value if  it is really needed (single 
table strategy). Since the class type for the strategy joined is clear by 
itself the discriminator value will be null. You can use the following hack to 
work around this:


  |     /*
  |      * This is workaround for a hibernate bug:
  |      *  -> 
http://opensource.atlassian.com/projects/hibernate/browse/ANN-140?page=all 
  |      */  
  |     @Column(name="DISCRIMINATOR",length=31)
  |     public String getDiscriminatorValue() {
  |             DiscriminatorValue discriminatorValueAnnotation = 
this.getClass().getAnnotation(DiscriminatorValue.class);
  |             if (discriminatorValueAnnotation != null) {
  |                     return discriminatorValueAnnotation.value();
  |             }
  |             return this.getClass().getSimpleName();
  |     }
  |     
  |     public void setDiscriminatorValue(String dummy) {
  |     }
  | 

You will have to tweak it to use an integer as the discriminator value.

Regards

Felix

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072913#4072913

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072913
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to