Results 1 to 2 of 2

Thread: Spring Data JPA + Oracle + Paging issue?

  1. #1
    Join Date
    Mar 2007
    Posts
    128

    Question Spring Data JPA + Oracle + Paging issue?

    I'm trying out using Spring Data JPA with Hibernate and Oracle 11g. I could have sworn I had this working before, but I haven't touched the code in a few weeks and just got back to it so I'm not positive

    In my repository interface I have a method like this:
    Code:
    public Page<Log> findByCreateByDttmAfter(Date createByDate, Pageable pageable);
    When I run the application I am getting a "ORA-00933: SQL command not properly ended" error. There are two sqls from Hibernate that is displaying in the logs. One is to get a count of how many rows will be returned and that seems to be ok.

    Code:
    select count(*) as col_0_0_ from LOG log0_ where log0_.CREATE_BY_DTTM>?
    The second one is what's causing the issue:
    Code:
    select <fields_removed_for_brevity>
    from LOG log0_ where log0_.CREATE_BY_DTTM>? order by log0_.CREATE_BY_DTTM desc limit ?
    If I remove the limit clause in an oracle client, the sql will work. I don't THINK oracle has a limit clause but uses a rownum < ? type of thing. Is Hibernate creating this sql or is this Spring Data? Is there something special I need to set for Oracle?

  2. #2
    Join Date
    Mar 2007
    Posts
    128

    Default

    Nevermind. Found it.

    Code:
    <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    	<property name="generateDdl" value="true" />
    	<property name="showSql" value="true" />
    	<property name="database" value="ORACLE" />
    </bean>

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
  •