Envers failed to create AUD table with large strings
----------------------------------------------------
Key: HHH-6277
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6277
Project: Hibernate Core
Issue Type: Bug
Components: envers
Environment: MySQL, Envers 1.2.2 GA
Reporter: Matthew Casperson
In my application, Envers failed to create a AUD table for an entity that included a large
string property (mapped to a TEXT column in MySQL). So the following class failed to
generate a AUD table:
package com.redhat.topicindex.entity;
// Generated Apr 19, 2011 6:51:53 AM by Hibernate Tools 3.4.0.CR1
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.envers.Audited;
import org.hibernate.validator.Length;
/**
* Help generated by hbm2java
*/
@Entity
@Audited
@Table(name = "Help", catalog = "Topicize")
public class Help implements java.io.Serializable
{
private static final long serialVersionUID = 8247134318338564478L;
private Integer helpId;
private String tableColId;
private String helpText;
public Help() {
}
public Help(String tableColId, String helpText) {
this.tableColId = tableColId;
this.helpText = helpText;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "HelpID", unique = true, nullable = false)
public Integer getHelpId() {
return this.helpId;
}
public void setHelpId(Integer helpId) {
this.helpId = helpId;
}
@Column(name = "TableColID", length = 512)
@Length(max = 512)
public String getTableColId() {
return this.tableColId;
}
public void setTableColId(String tableColId) {
this.tableColId = tableColId;
}
@Column(name = "HelpText", length = 65535)
@Length(max = 65535)
public String getHelpText() {
return this.helpText;
}
public void setHelpText(String helpText) {
this.helpText = helpText;
}
}
Once the HelpText property was modified, the AUD table was created:
package com.redhat.topicindex.entity;
// Generated Apr 19, 2011 6:51:53 AM by Hibernate Tools 3.4.0.CR1
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.envers.Audited;
import org.hibernate.validator.Length;
/**
* Help generated by hbm2java
*/
@Entity
@Audited
@Table(name = "Help", catalog = "Topicize")
public class Help implements java.io.Serializable
{
private static final long serialVersionUID = 8247134318338564478L;
private Integer helpId;
private String tableColId;
private String helpText;
public Help() {
}
public Help(String tableColId, String helpText) {
this.tableColId = tableColId;
this.helpText = helpText;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "HelpID", unique = true, nullable = false)
public Integer getHelpId() {
return this.helpId;
}
public void setHelpId(Integer helpId) {
this.helpId = helpId;
}
@Column(name = "TableColID", length = 512)
@Length(max = 512)
public String getTableColId() {
return this.tableColId;
}
public void setTableColId(String tableColId) {
this.tableColId = tableColId;
}
@Column(name = "HelpText", length = 2048)
@Length(max = 2048)
public String getHelpText() {
return this.helpText;
}
public void setHelpText(String helpText) {
this.helpText = helpText;
}
}
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira