Rejected
Details
Assignee
UnassignedUnassignedReporter
SSBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
SAffects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
S
SBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
S
Affects versions
Priority
Created July 15, 2010 at 4:58 PM
Updated July 15, 2010 at 6:59 PM
Resolved July 15, 2010 at 6:59 PM
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.