4 Replies Latest reply on Feb 28, 2010 5:29 PM by Paolo Asioli

    Hibernate - ORA-00907: missing right parenthesis

    Charlie B Newbie

      Hi,


      I am new to Seam and have used the seam-gen tool to generate a few Entities and forms for standard CRUD operations.


      When I run the app, i receive the ORA-00907: missing right parenthesis error on one of my entities.



      13:49:42,285 INFO  [STDOUT] Hibernate:
          select
              *
          from
              ( select
                  manualoper0_.VDATE as VDATE178_,
                  manualoper0_.SITEID as SITEID178_,
                  manualoper0_.VTIME as VTIME178_,
                  manualoper0_.SVALUE as SVALUE178_,
                  manualoper0_.VARID as VARID178_
              from
                  MANOPSREAD manualoper0_ )
          where
              rownum <= ?
      13:49:42,300 INFO  [STDOUT] Hibernate:
          select
              *
          from
              ( select
                  count((manualoper0_.VDATE,
                  manualoper0_.SITEID,
                  manualoper0_.VTIME,
                  manualoper0_.SVALUE,
                  manualoper0_.VARID)) as col_0_0_
              from
                  MANOPSREAD manualoper0_ )
          where
              rownum <= ?
      




      I have found similar errors to this using google...but they all mention that a problem in the hibernate-annotation.jar which was causing this, has since been corrected.


      Here are my classes - seam-gen has created two entities instead of the normal one for this table:




      package au.com.statewater.koncentrator.model;
      // Generated 21/10/2009 11:03:56 AM by Hibernate Tools 3.2.4.GA
      
      import javax.persistence.Column;
      import javax.persistence.Embeddable;
      import org.hibernate.validator.Length;
      
      /**
       * ManualOperationsReadId generated by hbm2java
       */
      @Embeddable
      public class ManualOperationsReadId implements java.io.Serializable {
      
           private String siteId;
           private String variableId;
           private String date;
           private String time;
           private String value;
      
           public ManualOperationsReadId() {
           }
      
           public ManualOperationsReadId(String siteId, String variableId,
                     String date, String time, String value) {
                this.siteId = siteId;
                this.variableId = variableId;
                this.date = date;
                this.time = time;
                this.value = value;
           }
      
           @Column(name = "SITEID", length = 10)
           @Length(max = 10)
           public String getSiteId() {
                return this.siteId;
           }
      
           public void setSiteId(String siteId) {
                this.siteId = siteId;
           }
      
           @Column(name = "VARID", length = 10)
           @Length(max = 10)
           public String getVariableId() {
                return this.variableId;
           }
      
           public void setVariableId(String variableId) {
                this.variableId = variableId;
           }
      
           @Column(name = "VDATE", length = 20)
           @Length(max = 20)
           public String getDate() {
                return this.date;
           }
      
           public void setDate(String date) {
                this.date = date;
           }
      
           @Column(name = "VTIME", length = 20)
           @Length(max = 20)
           public String getTime() {
                return this.time;
           }
      
           public void setTime(String time) {
                this.time = time;
           }
      
           @Column(name = "SVALUE", length = 10)
           @Length(max = 10)
           public String getValue() {
                return this.value;
           }
      
           public void setValue(String value) {
                this.value = value;
           }
      
           public boolean equals(Object other) {
                if ((this == other))
                     return true;
                if ((other == null))
                     return false;
                if (!(other instanceof ManualOperationsReadId))
                     return false;
                ManualOperationsReadId castOther = (ManualOperationsReadId) other;
      
                return ((this.getSiteId() == castOther.getSiteId()) || (this
                          .getSiteId() != null
                          && castOther.getSiteId() != null && this.getSiteId().equals(
                          castOther.getSiteId())))
                          && ((this.getVariableId() == castOther.getVariableId()) || (this
                                    .getVariableId() != null
                                    && castOther.getVariableId() != null && this
                                    .getVariableId().equals(castOther.getVariableId())))
                          && ((this.getDate() == castOther.getDate()) || (this.getDate() != null
                                    && castOther.getDate() != null && this.getDate()
                                    .equals(castOther.getDate())))
                          && ((this.getTime() == castOther.getTime()) || (this.getTime() != null
                                    && castOther.getTime() != null && this.getTime()
                                    .equals(castOther.getTime())))
                          && ((this.getValue() == castOther.getValue()) || (this
                                    .getValue() != null
                                    && castOther.getValue() != null && this.getValue()
                                    .equals(castOther.getValue())));
           }
      
           public int hashCode() {
                int result = 17;
      
                result = 37 * result
                          + (getSiteId() == null ? 0 : this.getSiteId().hashCode());
                result = 37
                          * result
                          + (getVariableId() == null ? 0 : this.getVariableId()
                                    .hashCode());
                result = 37 * result
                          + (getDate() == null ? 0 : this.getDate().hashCode());
                result = 37 * result
                          + (getTime() == null ? 0 : this.getTime().hashCode());
                result = 37 * result
                          + (getValue() == null ? 0 : this.getValue().hashCode());
                return result;
           }
      
      }






      package au.com.statewater.koncentrator.model;
      // Generated 21/10/2009 11:03:56 AM by Hibernate Tools 3.2.4.GA
      
      import javax.persistence.AttributeOverride;
      import javax.persistence.AttributeOverrides;
      import javax.persistence.Column;
      import javax.persistence.EmbeddedId;
      import javax.persistence.Entity;
      import javax.persistence.FetchType;
      import javax.persistence.JoinColumn;
      import javax.persistence.ManyToOne;
      import javax.persistence.Table;
      
      /**
       * ManualOperationsRead generated by hbm2java
       */
      @Entity
      @Table(name = "MANOPSREAD")
      public class ManualOperationsRead implements java.io.Serializable {
      
           private ManualOperationsReadId id;
           private Variables variables;
           private Site site;
      
           public ManualOperationsRead() {
           }
      
           public ManualOperationsRead(ManualOperationsReadId id) {
                this.id = id;
           }
           public ManualOperationsRead(ManualOperationsReadId id, Variables variables,
                     Site site) {
                this.id = id;
                this.variables = variables;
                this.site = site;
           }
      
           @EmbeddedId
           @AttributeOverrides({
                     @AttributeOverride(name = "siteId", column = @Column(name = "SITEID", length = 10)),
                     @AttributeOverride(name = "variableId", column = @Column(name = "VARID", length = 10)),
                     @AttributeOverride(name = "date", column = @Column(name = "VDATE", length = 20)),
                     @AttributeOverride(name = "time", column = @Column(name = "VTIME", length = 20)),
                     @AttributeOverride(name = "value", column = @Column(name = "SVALUE", length = 10))})
           public ManualOperationsReadId getId() {
                return this.id;
           }
      
           public void setId(ManualOperationsReadId id) {
                this.id = id;
           }
      
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "VARID", insertable = false, updatable = false)
           public Variables getVariables() {
                return this.variables;
           }
      
           public void setVariables(Variables variables) {
                this.variables = variables;
           }
      
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "SITEID", insertable = false, updatable = false)
           public Site getSite() {
                return this.site;
           }
      
           public void setSite(Site site) {
                this.site = site;
           }
      
      }



      Can anyone help me figure this out.
      Much appreciated.


      Charlie