Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    42

    Unanswered: JPA annotating a string property to a MySQL text column

    Hello,

    I have a MySQL text column: profile text

    I'm trying to map a property to it using a JPA annotation.

    @Lob
    private String profile;

    The @Lob annotation gives me the error message:

    Wrong column type in db_integration.admin for column profile. Found: text, expected: longtext

    I'm using the MySQL Server version: 5.0.45-log Source distribution.

    My dependencies are:

    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-annotations</artifactId>
    <version>3.5.6-Final</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate.javax.persistence</groupId>
    <artifactId>hibernate-jpa-2.0-api</artifactId>
    <version>1.0.1.Final</version>
    </dependency>
    <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-jpa</artifactId>
    <version>1.3.0.RELEASE</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>${hibernate.version}</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>${hibernate.version}</version>
    </dependency>

    with
    <properties>
    <hibernate.version>3.6.9.Final</hibernate.version>
    </properties>

    Any clue ?

  2. #2
    Join Date
    Oct 2012
    Posts
    42
    I solved the issue with the following:

    @Lob
    @Column(columnDefinition="TEXT")

    Now, let's wait to see how this will work on other RDBMS servers like Oracle...

Tags for this Thread

Posting Permissions

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