[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-436) @IndexColumn does not work with discriminator-inheritance on the target entity of the list

Christoph Schönfeld (JIRA) noreply at atlassian.com
Wed Feb 14 14:55:40 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-436?page=comments#action_26116 ] 

Christoph Schönfeld commented on ANN-436:
-----------------------------------------

I documented a workaround at the Hibernate User forum.
http://forum.hibernate.org/viewtopic.php?t=944305&highlight=


> @IndexColumn does not work with discriminator-inheritance on the target entity of the list
> ------------------------------------------------------------------------------------------
>
>          Key: ANN-436
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-436
>      Project: Hibernate Annotations
>         Type: Bug

>     Versions: 3.2.0.cr1
>     Reporter: ron piterman

>
>
> When using inheritance on the target entity of a List, @IndexColumn annotation does not work. Hibernate does not populate the index column value on the target entites. As a result, the sort_order column is null.
> @Entity
> public class PropertyOwner {
>   @OneToMany
>   @IndexColumn(name="sort_order", mappedBy="owner",cascade=CascadeType.ALL)
>   private List<AbstractProperty> properties;
> ... 
> }
>   
> @Entity
> @DiscriminatorColumn(name="property_type",discriminatorType=DiscriminatorType.STRING)
> public abstract class AbstractProperty {
>   @ManyToOne
>   private PropertyOwner owner;
> }
> @Entity
> @DiscriminatorValue("integer")
> public class IntegerProperty extends AbstractProperty {
>   
>   int integerValue;
>   ...
> }
> @Entity
> @DiscriminatorValue("string")
> public class IntegerProperty extends AbstractProperty {
>   
>   String stringValue
>   ...
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira





More information about the hibernate-issues mailing list