[
http://jira.jboss.com/jira/browse/JBSEAM-2742?page=all ]
David Cloutier updated JBSEAM-2742:
-----------------------------------
Description:
When running seam generate-entities on a legacy Oracle database with a table named
"ENTITY" the generate-entities fails during the compilation step because of the
ambiguity between Hibernates Entity annotation and the Entity model class created by
seam-gen.
Enitity.java:
package com.mydomain.cat2.entity;
// Generated 13-Mar-2008 3:13:39 PM by Hibernate Tools 3.2.0.CR1
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
/**
* Entity generated by hbm2java
*/
@Entity
@Table(name = "ENTITY", uniqueConstraints = @UniqueConstraint(columnNames = {
"ENTITY_NAME", "ENTITY_TYPE"}))
public class Entity implements java.io.Serializable {
private long entityId;
private String entityName;
private String entityType;
private Date creationDate;
private Date modifiedDate;
private Set<PropertyValue> propertyValues = new HashSet<PropertyValue>(0);
public Entity() {
}
public Entity(long entityId, String entityName, String entityType,
Date creationDate, Date modifiedDate) {
this.entityId = entityId;
this.entityName = entityName;
this.entityType = entityType;
this.creationDate = creationDate;
this.modifiedDate = modifiedDate;
}
public Entity(long entityId, String entityName, String entityType,
Date creationDate, Date modifiedDate,
Set<PropertyValue> propertyValues) {
this.entityId = entityId;
this.entityName = entityName;
this.entityType = entityType;
this.creationDate = creationDate;
this.modifiedDate = modifiedDate;
this.propertyValues = propertyValues;
}
@Id
@Column(name = "ENTITY_ID", unique = true, nullable = false, precision = 15,
scale = 0)
@NotNull
public long getEntityId() {
return this.entityId;
}
public void setEntityId(long entityId) {
this.entityId = entityId;
}
@Column(name = "ENTITY_NAME", nullable = false, length = 200)
@NotNull
@Length(max = 200)
public String getEntityName() {
return this.entityName;
}
public void setEntityName(String entityName) {
this.entityName = entityName;
}
@Column(name = "ENTITY_TYPE", nullable = false, length = 100)
@NotNull
@Length(max = 100)
public String getEntityType() {
return this.entityType;
}
public void setEntityType(String entityType) {
this.entityType = entityType;
}
@Temporal(TemporalType.DATE)
@Column(name = "CREATION_DATE", nullable = false, length = 7)
@NotNull
public Date getCreationDate() {
return this.creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
@Temporal(TemporalType.DATE)
@Column(name = "MODIFIED_DATE", nullable = false, length = 7)
@NotNull
public Date getModifiedDate() {
return this.modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy =
"entity")
public Set<PropertyValue> getPropertyValues() {
return this.propertyValues;
}
public void setPropertyValues(Set<PropertyValue> propertyValues) {
this.propertyValues = propertyValues;
}
}
was:
When running seam generate-entities on a legacy Oracle database with a table named
"ENTITY" the generate-entities fails during the compilation step because of the
ambiguity between Hibernates Entity annotation and the Entity model class created by
seam-gen.
SEAM genereate-entities fails during the model compilation when
legacy table name is "ENTITY" .
-----------------------------------------------------------------------------------------------
Key: JBSEAM-2742
URL:
http://jira.jboss.com/jira/browse/JBSEAM-2742
Project: JBoss Seam
Issue Type: Bug
Components: Tools
Affects Versions: 2.1.0.A1, 2.0.1.GA
Environment: Windows XP. JBoss 4 AS, Java 1.6
Reporter: David Cloutier
Fix For: 2.1.x
When running seam generate-entities on a legacy Oracle database with a table named
"ENTITY" the generate-entities fails during the compilation step because of the
ambiguity between Hibernates Entity annotation and the Entity model class created by
seam-gen.
Enitity.java:
package com.mydomain.cat2.entity;
// Generated 13-Mar-2008 3:13:39 PM by Hibernate Tools 3.2.0.CR1
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
/**
* Entity generated by hbm2java
*/
@Entity
@Table(name = "ENTITY", uniqueConstraints = @UniqueConstraint(columnNames = {
"ENTITY_NAME", "ENTITY_TYPE"}))
public class Entity implements java.io.Serializable {
private long entityId;
private String entityName;
private String entityType;
private Date creationDate;
private Date modifiedDate;
private Set<PropertyValue> propertyValues = new HashSet<PropertyValue>(0);
public Entity() {
}
public Entity(long entityId, String entityName, String entityType,
Date creationDate, Date modifiedDate) {
this.entityId = entityId;
this.entityName = entityName;
this.entityType = entityType;
this.creationDate = creationDate;
this.modifiedDate = modifiedDate;
}
public Entity(long entityId, String entityName, String entityType,
Date creationDate, Date modifiedDate,
Set<PropertyValue> propertyValues) {
this.entityId = entityId;
this.entityName = entityName;
this.entityType = entityType;
this.creationDate = creationDate;
this.modifiedDate = modifiedDate;
this.propertyValues = propertyValues;
}
@Id
@Column(name = "ENTITY_ID", unique = true, nullable = false, precision = 15,
scale = 0)
@NotNull
public long getEntityId() {
return this.entityId;
}
public void setEntityId(long entityId) {
this.entityId = entityId;
}
@Column(name = "ENTITY_NAME", nullable = false, length = 200)
@NotNull
@Length(max = 200)
public String getEntityName() {
return this.entityName;
}
public void setEntityName(String entityName) {
this.entityName = entityName;
}
@Column(name = "ENTITY_TYPE", nullable = false, length = 100)
@NotNull
@Length(max = 100)
public String getEntityType() {
return this.entityType;
}
public void setEntityType(String entityType) {
this.entityType = entityType;
}
@Temporal(TemporalType.DATE)
@Column(name = "CREATION_DATE", nullable = false, length = 7)
@NotNull
public Date getCreationDate() {
return this.creationDate;
}
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
@Temporal(TemporalType.DATE)
@Column(name = "MODIFIED_DATE", nullable = false, length = 7)
@NotNull
public Date getModifiedDate() {
return this.modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy =
"entity")
public Set<PropertyValue> getPropertyValues() {
return this.propertyValues;
}
public void setPropertyValues(Set<PropertyValue> propertyValues) {
this.propertyValues = propertyValues;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira