[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4300) Composite Key which contains a discriminator causes "Repeated Column" errors
Jason Ferguson (JIRA)
noreply at atlassian.com
Thu May 10 07:50:11 EDT 2012
[ https://hibernate.onjira.com/browse/HHH-4300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46592#comment-46592 ]
Jason Ferguson commented on HHH-4300:
-------------------------------------
Since the maintainers are actively ignoring this issue, I ended up using multiple id's and a @Where annotation to get around this.
{code:title=Sqi.java|borderStyle=solid}
@Entity
@Where(clause = "CODE_TYPE='SQI'")
@Table(name = "T_CODE_VAL")
public class Sqi implements DomainObject, Serializable {
private static final long serialVersionUID = 1L;
private String type;
private String value;
private String description;
@Id
@Column(name = "CODE_TYPE", insertable = false, updatable = false)
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Id
@Column(name = "CODE_VALUE", insertable = false, updatable = false)
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Column(name = "DESCRIPTION", insertable = false, updatable = false)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
{code}
> Composite Key which contains a discriminator causes "Repeated Column" errors
> ----------------------------------------------------------------------------
>
> Key: HHH-4300
> URL: https://hibernate.onjira.com/browse/HHH-4300
> Project: Hibernate ORM
> Issue Type: Bug
> Components: annotations
> Environment: Hibernate version: 3.3.1 GA
> Application Server: Glassfish V3 Prelude
> Database: Oracle 9i
> Reporter: Pasi Orovuo
> Attachments: ItemInfo.zip
>
>
> See this forum post for background:
> http://forum.hibernate.org/viewtopic.php?t=995693
> Annotations does not seem to have a possibility to define "insert = false" on a discriminator column, as mentioned in the following bug:
> http://opensource.atlassian.com/projects/hibernate/browse/HB-1149
> Sources of classes that demonstrate the problem in above forum case attached.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list