Results 1 to 4 of 4

Thread: org.hibernate.util.JDBCExceptionReporter - [SQL0205] Column VERSION not in table

  1. #1

    Default org.hibernate.util.JDBCExceptionReporter - [SQL0205] Column VERSION not in table

    Hi
    I just downloaded roo 1.1.0M3 and then trying to create web application for an existing table,
    I was able to built the application without problem, but when i am trying to run it, i get following error
    ERROR org.hibernate.util.JDBCExceptionReporter - [SQL0205] Column VERSION not in table XREF_GLOBALID in TRS030.

    I have added versionField = "" to my model, still i get this error.

    what am i missing,
    the table has following columns,


    GLOBALIDID 1 9 0 B (key)
    GLOBALIDCD 5 16 A
    DESC 21 40 A

    and my model looks like below

    @Entity
    @RooJavaBean
    @RooToString
    @Table(name = "XREF_GLOBALID")
    @RooEntity(identifierField = "GLOBALIDID", identifierColumn = "GLOBALIDID", versionField = "", finders = { "findXrefGlobalIdsByGLOBALIDCDLike" })
    public class XrefGlobalId {

    @NotNull
    @Size(max = 16)
    private String GLOBALIDCD;

    @NotNull
    @Size(max = 40)
    private String DESCRIPTION;
    }

    so what am i missing

    And i have added

  2. #2
    Join Date
    Nov 2009
    Location
    Montreal, Quebec
    Posts
    398

    Default

    I had this problem too using existing tables that didn't have any version columns. What I did was to add a version field to my entity class annotated with @Version, but I also annotated it with @Transient. Seems to make Hibernate happy. You'll need to create the getters/setters yourself too.

  3. #3

    Default

    Thanks I added, following line of code and it worked fine
    @Version
    @Transient
    private Integer version;

    public Integer getVersion() {
    return version;
    }

    public void setVersion(Integer version) {
    this.version = version;
    }

  4. #4

    Default

    This is strange in spring roo 1.0.2
    i could add ersionField = "" as below and it worked fine,

    @RooEntity(identifierField = "GLOBALIDID", identifierColumn = "GLOBALIDID", versionField = "", finders = { "findXrefGlobalIdsByGLOBALIDCDLike" })

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •