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

    Unanswered: How to annotate in JPA for a text column with string size 65535 ?


    In a JPA enviroment, how to annotate a column that is supposed to receive text strings of up to 65535 characters ?

    I have an issue with using the following annotation for the column profile:

    @Column(columnDefinition = "TEXT", length = 65535)
    private String profile;

    It works fine on MySQL and on H2 but not on my HSQLDB 2.2.9

    I wonder how to specify a string of size 65535 in a JPA HSQLDB environment.

    I'm using hibernate-jpa-2.0-api 1.0.1.Final and hibernate-annotations 3.5.6-Final and hsqldb 2.2.9 and spring-data-jpa 1.3.0.RELEASE

  2. #2
    Join Date
    Oct 2012
    Using the following url in the data source properties

    using the dataSource.url=jdbc:log4jdbc:hsqldb:mem:db_integra tion;sql.syntax_mys=true

    solved the isue.

    But I still have one question: how come using HSQLDB withOUT any MySQL property works fine when accessed through an Hibernate DAO and not when accessed through a JPA repository ?

    The point of testing either against a MySQL database or an HSQLDB database is that these two being a bit different, I can make sure my code is portable. Now if I tell one, the HSQLDB database to behave as the other then there is less point in using it.

    It's like HSQLDB behaves in a MySQL-like way when accessed through an Hibernate DAO but behaves in a non-MySQL-like way when accessed through a JPA repository.

    By DAO I referred to my own layer of data access code. Using Hibernate works just fine against HSQLDB without the additional url property. But using JPA requires the url property apparently. It's too bad.

    See the thread at

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