[hibernate-issues] [Hibernate-JIRA] Created: (HCANN-28) Polymorphic Query on named field using @Inheritance(strategy=InheritanceType.JOINED)

Sean Tozer (JIRA) noreply at atlassian.com
Thu Jul 15 10:59:13 EDT 2010


Polymorphic Query on named field using @Inheritance(strategy=InheritanceType.JOINED)
------------------------------------------------------------------------------------

                 Key: HCANN-28
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HCANN-28
             Project: Hibernate Commons Annotations
          Issue Type: Bug
    Affects Versions: 3.2.0
            Reporter: Sean Tozer


Using a Joined table strategy and annotation definitions, Hibernate does not respect the name parameter from a column annotation, as in @Column(name = "ES_CELL_LINE"), in the generation of a polymorphic query on the parent type.

@Entity
@Table(name = "GENOTYPE")
@Inheritance(strategy=InheritanceType.JOINED)
public class Genotype implements java.io.Serializable {
	private int genotypeKey;
...
}

@Entity
@Table(name = "GENOTYPE_TARGETED")
public class GenotypeTargeted extends Genotype {

    private String ESCellLine;

    @Column(name = "ES_CELL_LINE", length = 32)
    @Length(max = 32)
    public void setESCellLine(String eSCellLine) {
    	ESCellLine = eSCellLine;
    }
    public String getESCellLine() {
    	return ESCellLine;
    }
}


Using the query "select distinct g from Genotype g" produces a query containing "genotype4_1_.ESCellLine as ESCellLine69_3_," rather than "genotype4_1_.ES_CELL_LINE as ESCellLine69_3_," as would be expected. All named fields from the parent class are correct, while all named fields from the subclasses use the field name rather than the value of the name parameter.

-- 
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