Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2742

SEAM genereate-entities fails during the model compilation when legacy table name is "ENTITY" .

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1.GA, 2.1.0.A1
    • Fix Version/s: The future
    • Component/s: Tools
    • Labels:
      None
    • Environment:

      Windows XP. JBoss 4 AS, Java 1.6

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

      }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dacloutier David Cloutier
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: