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

ron piterman (JIRA) noreply at atlassian.com
Fri Sep 8 11:42:24 EDT 2006


@IndexColumn does not work with discriminator-inheritance on the target entity of the list
------------------------------------------------------------------------------------------

         Key: ANN-437
         URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-437
     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. 

(In the code example below a generator for the @ID is missing.)

@Entity
public class PropertyOwner {

  @Id
  private Long id;

  @OneToMany(mappedBy="owner",cascade=CascadeType.ALL)
  @IndexColumn(name="sort_order")
  private List<AbstractProperty> properties;

...
}
  

@Entity
@DiscriminatorColumn(name="property_type",discriminatorType=DiscriminatorType.STRING)
public abstract class AbstractProperty {

  @Id
  private Long id;

  @ManyToOne
  private PropertyOwner owner;

}

@Entity
@DiscriminatorValue("integer")
public class IntegerProperty extends AbstractProperty {
  
  int integerValue;

  ...
}

@Entity
@DiscriminatorValue("string")
public class StringProperty 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